tags:

views:

201

answers:

4

A third party library I'm utilizing provided the JavaDoc HTML and associated bin files in a zip file. How can I create a jar file from the JavaDoc HTML?

Thanks.

+1  A: 

Quick answer: You can take all the files in a ZIP and put it .jar extension

victor hugo
A JAR file can be compressed, it may just lead to bad performance.
Michael Borgwardt
+5  A: 

A JAR file is nothing but a ZIP file with an (optional) manifest file inside.

Basically, rename the file to .JAR and that's it.

Michael Borgwardt
interesting. didn't realize the manifest was optional.
javacavaj
Well, I haven't looked at the spec, and of course there's a lot of functionality that depends on information in the manifest, but I've yet to see any Java tool outright rejecting a JAR file just because it lacks a manifest.
Michael Borgwardt
A: 

By zipping the files and renaming the compressed package .jar? (JAR files are basically just ZIP files.)

But why would you want to create a JAR out of the HTML files?

Jonik
Some IDEs like to link to the javadocs in a .jar file.
Chris Nava
Yeah, I was wondering if it had to do with IDEs. With smart IDEs you wouldn't need to do such a thing, of course, as you can attach Javadocs directly from ZIPs/JARs/directories/URLs. :)
Jonik
Your are correct. Is IDE related. I would much prefer to reference a URL.
javacavaj
That's possible at least in IntelliJ IDEA, and I believe in Eclipse too.
Jonik
A: 

Of course you could just unzip the zip file and add the lib folder you just decompressed to your classpath.

Hardwareguy