16 Deploying an OHJ Help System

The following sections describe how to deploy an OHJ help system with your product:

16.1 Supported Java Virtual Machines

Since OHJ is a Java application (or applet), it must run in a Java Virtual Machine (JVM). That means that you must ensure that your users have an appropriate JVM installed. If you are using OHJ as help for a Java application, that application must also run in a virtual machine, so it is likely that the JVM is already being distributed with your application.

16.2 Which OHJ JAR Files Must Be Shipped

The following JAR (Java ARchive) files must be redistributed as part of your product install. These files contain the OHJ engine implementation and its dependencies. For more information about these files, see Section 13.2.2, "Contents of an OHJDK Release".

  • helpversion_num.jar

  • oracle_ice.jar

16.3 Deploying Compressed Help Content in JARs

Java based applications are often distributed in JAR format. You may wish to include your Help content as a JAR file in your distribution, as HTML content files are significantly reduced in size by JAR compression.

16.3.1 Creating JAR files

To create JAR files, use the JAR tool that is distributed with your Java Development Kit. If you are using a third party help authoring system that supports OHJ, it may also be able to perform this task.

Special care should be given to the organization of files and their assigned paths within the JAR archives. The directory structure within your help JAR file must match the directory structure for your product implementation JAR files. Your help content should be after the location of the implementation class that you use as a reference point.

For example,

If your product implementation JAR includes classes with the following directory structure,

/com/yourCompany/yourProduct/SomeProduct.class 
/com/yourCompany/yourProduct/SomeClass.class

then your help JARs should contain the matching paths so that the help content is below the product implementation classes in the shared directory structure:

/com/yourCompany/yourProduct/help/ProductHelp.hs 
/com/yourCompany/yourProduct/help/TableOfContents.xml 
/com/yourCompany/yourProduct/help/SomeHelpTopic.html

16.3.2 Which Book Constructor to Use

To create a Book object with help content loaded from a JAR file, the help JAR file and implementation JAR files must be on the system CLASSPATH. If you have organized the JAR files as described, then you know the location of the help content is relative to the location of your implementation classes on the CLASSPATH.

Thus, you will use the versions of the HelpSet constructors that accept a Java class and a relative path from that class.

For example, if you have two JAR files, construct the helpset object using the following code:

import com.yourCompany.yourProduct.SomeProduct; 
helpset myhelpset = new helpset(SomeProduct.class, "help/ProductHelp.hs");