This chapter includes the following sections:
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.
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.3.2, "Contents of an OHJDK Release".
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.
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.
If your product implementation JAR includes classes with the following directory structure,
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
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");