Java and OpenOffice.org

From Apache OpenOffice Wiki
Revision as of 13:25, 29 November 2005 by Mtg (Talk | contribs)

Jump to: navigation, search

OpenOffice.org 2.0 Functionality depending on Java

for use Java in OpenOffice.org, please see

OpenOffice.org Base

  • Create Form Wizard

OpenOffice.org Writer

  • Letter Wizard
  • Fax Wizard
  • Agenda Wizard
  • HTML Wizard
  • SaveAs -> AportisDoc (Palm)
  • SaveAs -> DocBook
  • SaveAs -> Pocket Word (*.psw)

OpenOffice.org Calc

  • SaveAs -> Pocket Excel

All

Question: What is exactly not working ? Tools->Organzie Macros -> JavaScript|Beanshell|Python pops up a message boxes that no JRE is installed but then the Dialog is displayed (see http://www.openoffice.org/issues/show_bug.cgi?id=37020)

Java detection in OpenOffice.org 2 and StarOffice 8

Which Java will be used?

StarOffice tries to detect the newest Java version installed. StarOffice only detects Sun Java versions, while OpenOffice.org also detects Java versions from other vendors.

When using versions from different vendors, the numbering system might be different so maybe not the newest version is used. You can change the Java version in StarOffice via tools/options/Java.

On GNOME, if AT tool support is enabled, StarOffice will use that latest version where the Java Access Bridge is enabled.

When is Java detection done?

On Windows, detection is done the first time Java is used. On Linux/Solaris, detection is done the first time a user starts StarOffice.

How do I debug Java components in OpenOffice.org?

You must go to Tools.Options.OpenOffice.org.Java, and click 'Parameters' for your chosen JVM. This allows you to pass options into the JVM when it is initialised. At a minimum you will need something similar to:

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

Note that when you are running a JVM with 'suspend=y' and you attempt to register a Java component, it will hang waiting for you to connect a debugger. In this case, you need to close down Office, change the configuration back, register the component, then re-start office, add in the JVM parameters, then call the Java component again. To speed this process up a bit, you can edit the java settings file contained in your user config directory, which on windows will be something like:

C:\Documents and Settings\<windows username>\Application Data\OpenOffice.org2\user\config\java_settings_Windows_x86.xml

It contains an element called 'vmParameters'. When you have java debugging enabled it will look something like:

<vmParameters xsi:nil="false"> <param>-Xdebug</param> <param>-Xnoagent</param> <param>-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000</param> </vmParameters>

If you are not running with debug it will contain: <vmParameters xsi:nil="false"/>

It is a little bit quicker to manually edit this file between restarts then to use the UI.

How can I reset the Java configuration?

The configuration is stored in

< staroffice-config > /user/config/javasettings_ < platform > .xml

Just delete this file if you want StarOffice to detect again. The Java configuration file cannot be modified manually. The data format is not specified and may change anytime without further notice. Don't try to modify that file to change the Java version. The < location > and < version > entries are only for 'documentation', the Java version is accessed via the < vendorData > , which is binary.

External links

Personal tools