#### 20.3.5 Establishing an Oracle Help environment

To use Oracle Help for Java, you must have both Oracle Help and a Java Virtual Machine (JVM) installed on your system. Oracle Help version 5.0 requires Java SE version 5.0 or a later version. If you plan to create .jar files, you will also need jar.exe from the Java Developer’s Kit (JDK).

Oracle Help for Java is available for download from the Oracle Technology Network; see §20.2 Obtaining tools for a Java-based Help system.

Environment variables

Edit Windows System environment variable CLASSPATH (or create CLASSPATH if it is not already defined on your system):

Control Panel > System > Advanced > Environment Variables

What you add to CLASSPATH depends on which version of Oracle Help you are using; the dependencies and file names changed between versions 4 and 5.

If you are using Oracle Help version 4, append to CLASSPATH the following paths, separating each path from the next with a semicolon:

    where\you\installed\ohj\
    where\you\installed\ohj\help4.jar
    where\you\installed\ohj\help4-demo.jar
    where\you\installed\ohj\help4-indexer.jar
    where\you\installed\ohj\ohj-jewt.jar
    where\you\installed\ohj\oracle_ice.jar

For example (all on one line, of course):

    CLASSPATH=D:\ohelp\help4-indexer.jar;D:\ohelp\help4-demo.jar;D:\ohelp\help4.jar;D:\ohelp\ohj-jewt.jar;D:\ohelp\;D:\ohelp\oracle_ice.jar;D:\ohelp\help4-indexer.jar

If you are using Oracle Help version 5, append to CLASSPATH the following paths, separating each path from the next with a semicolon:

    where\you\installed\ohj\
    where\you\installed\ohj\ohj.jar
    where\you\installed\ohj\help-share.jar
    where\you\installed\ohj\share.jar
    where\you\installed\ohj\help-demo.jar
    where\you\installed\ohj\help-indexer.jar
    where\you\installed\ohj\jewt.jar
    where\you\installed\ohj\oracle_ice.jar

For example (all on one line, of course):

    CLASSPATH=g:\ohj5;g\ohj5\ohj.jar;g:\ohj5\help-share.jar;g:\ohj5\oracle_ice.jar;g:\ohj5\jewt.jar;g:\ohj5\share.jar;g:\ohj5\help-indexer.jar

Oracle Help viewer

Given these settings for CLASSPATH, if you have also established a path to java.exe in a current JRE (see §20.3.4 Establishing a JavaHelp environment), to view the results of generating Oracle Help you should be able to use a .bat file with commands like the following:

    cd where\you\installed\ohj
    java oracle.help.demo.ChoiceDemo "\path\to\MyOutput\help\MyDoc.hs"

In practice, for Oracle Help 5, we find that setting the CLASSPATH environment variable is not sufficient; you must still supply the same dependencies to the java command as an argument to -classpath. For example:

    cd G:\OHJ5
    REM The following java command must be all on one line:
    java -classpath "ohj.jar;help-share.jar;oracle_ice.jar;jewt.jar;share.jar;help-demo.jar" oracle.help.demo.ChoiceDemo "G:\OmniSys\UG\ohj\help\ugdita2go.hs" %*

Your experience might be different.

Previous Topic: 20.3.4 Establishing a JavaHelp environment

Next Topic: 20.3.6 Creating a directory structure for JavaHelp / Oracle Help

Parent Topic: 20.3 Setting up a JavaHelp or Oracle Help project

Sibling Topics:

20.3.1 Creating a JavaHelp or Oracle Help for Java project

20.3.2 Deciding where to locate configuration settings

20.3.3 Specifying output options for JavaHelp

20.3.4 Establishing a JavaHelp environment

20.3.6 Creating a directory structure for JavaHelp / Oracle Help

20.3.7 Configuring the helpset file

20.3.8 Coping with JavaHelp / Oracle Help viewer limitations

20.3.9 Compiling JavaHelp with Helen