Conversion to JavaHelp fails with a ZipException on my
Windows XP machine. I'm using Java 1.5 Update 1.
>java -jar lib\Javadoc2Help.jar -jhelp -src doc -dest
jhelp_build -param "index_files=y" -param "launch_viewer=y"
[INFO] Converting to JAVA HELP..
[INFO] Copying icons to icons dir..
ERROR: The system cannot find the path specified
java.util.zip.ZipException: The system cannot find the
path specified
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at
com.aurigalogic.javadoc2help.util.Util.copyResources(Util.java:72)
at
com.aurigalogic.javadoc2help.core.JHelpConverter.convert(JHelpConverter.java:62)
at
com.aurigalogic.javadoc2help.core.Driver.run(Driver.java:96)
at
com.aurigalogic.javadoc2help.cmdline.Converter.convert(Converter.java:141)
at
com.aurigalogic.javadoc2help.cmdline.Converter.<init>(Converter.java:85)
at
com.aurigalogic.javadoc2help.cmdline.Converter.main(Converter.java:71)
The reason for this is that jarFilePath gets something
like this: "/C:/javadoc2help/lib/Javadoc2Help.jar".
Note the additional "/" at the start of the path.
I modified copyResources to use the URI class to do the
conversion:
public static void copyResources\(String srcDir, String
destDir) throws Exception {
String resourcePath = RESOURCE_DIR + srcDir;
if (!resourcePath.endsWith(File.separator)) {
resourcePath += "/";
}
String jarFilePath =
Util.class.getResource(RESOURCE_DIR).getFile();
URI jarURI = new URI(jarFilePath.substring(0,
jarFilePath.indexOf("!")));
jarFilePath = (new File(jarURI)).getPath();
JarFile jarFile = new JarFile\(jarFilePath\);
....
}
This works fine but requires Java 1.4 or later.
Logged In: YES
user_id=271087
Javadoc2help has never been tested on jdk 1.5. next release
will test and fix this.