Difference between revisions of "Documentation/DevGuide/FirstSteps/Configuration"

From Apache OpenOffice Wiki
Jump to: navigation, search
(No difference)

Revision as of 07:30, 21 June 2007

Template:FirstSteps

Enable Java in OpenOffice.org

OpenOffice.org uses a Java Virtual Machine to instantiate components written in Java. From OpenOffice.org 2.0 on, Java is found automatically during startup, or latest when Java functionality is required. If you prefer to preselect a JRE or JDK, or if no Java is found, you can configure Java using the Tools – Options dialog in OpenOffice.org and select the section OpenOffice.org – Java section. In older versions of OpenOffice.org you can also easily tell the office which JVM to use: launch the jvmsetup executable from the programs folder under the OpenOffice.org, select an installed JRE or JDK and click OK. Close the OpenOffice.org including the Quickstarter in the taskbar and restart OpenOffice.org. Furthermore, open the Tools - Options dialog in OpenOffice.org, select the section OpenOffice.org - Security and make sure that the Java enable option is checked.

Use Java UNO class files

Next, the OpenOffice.org class files must be made known to the Java IDE. For NetBeans these Java UNO jar files must be mounted to a project. The following steps show how to create a new project and mount class files in NetBeans from version 3.5.1.

  1. From the Project menu, select Project Manager. Click the New... button in the Project Manager window to create a new project. NetBeans uses your new project as the current project.
  2. Activate the NetBeans Explorer window—it should contain a Filesystems item (to display the NetBeans Explorer window, click View - Explorer). Open its context menu and select Mount – Archive Files, navigate to the folder <OfficePath>/program/classes, choose at least jurt.jar, unoil.jar, ridl.jar and juh.jar in that directory and click Finish to mount the OpenOffice.org jars in your project. As an alternative, you can also mount files using File - Mount Filesystem.
  3. Finally you need a folder for the source files of your project. Choose Mount – Local Directory from the context menu of the Filesystems icon and use the file manager dialog to create a new folder somewhere in your file system. Select it without opening it and click Finish to add it to your project.

Add the API Reference to your IDE

We recommend to add the API and the Java UNO reference to your Java IDE to get online help for the OpenOffice.org API and the Java UNO runtime. In NetBeans 3.4.1, follow these steps:

  • Open your project and choose the Tools – Javadoc Manager menu. With the button Add Folder... add the folders docs/common/ref and docs/java/ref of your SDK installation to use the API and the Java UNO reference in your project.
  • You can now use Alt + F1 to view online help while the cursor is on a OpenOffice.org API or Java UNO identifier in the source editor window.
Personal tools