#### 20.6.2 Viewing a JAR file

To view a JavaHelp JAR file (for example, myproj.jar):

1. Open a Command Prompt window.
2. Navigate to the directory where java.exe is located (see §20.3.4 Establishing a JavaHelp environment).
3. Execute the following command (which must be all on one line):

       java -jar path\to\hsviewer.jar -helpset path\to\myproj.jar

You can include navigation and execution commands in a .bat file for convenience. For example:

    cd C:\Program Files\Java\j2re1.4.2_03\bin
    java -jar G:\jh20\demos\bin\hsviewer.jar -helpset g:\jh\myproj.jar

JAR files might have broken links

If your document includes cross references or hypertext links that contain file names that do not match the case of the target file name, the links will not work when you view the JAR file. You can correct this problem either of the following ways:

- Change all file names in your DITA document to lowercase, and set [HTMLOptions]MakeFileHrefsLower=Yes; see §28.2.6 Forcing link text to lowercase.
- Inspect every cross-reference and hypertext PI marker in your document, and either fix the markers or change the case of the DITA file name.

On Windows you can get around the case mismatch problem by viewing the .hs file instead of the .jar file.

Viewing an Oracle Help JAR file is problematic

Although creating a JAR file for an Oracle Help project appears to work correctly, at Omni Systems we have not succeeded in viewing the resulting JAR file on Windows. On the other hand, Oracle Help .hs files can be viewed successfully on Windows.

See also:

§20.3.5 Establishing an Oracle Help environment.

Previous Topic: 20.6.1 Creating a JAR file

Next Topic: 20.7 Converting a glossary to JavaHelp 2

Parent Topic: 20.6 Creating and viewing a Java Archive (JAR) file

Sibling Topics:

20.6.1 Creating a JAR file