PDA

Click to See Complete Forum and Search --> : Jar File


Gal
Jul 27th, 2003, 05:24 PM
I have a Java source code in a form of an Executable Jar File. how can I get to the source code of this file? can I do it in Visual J++?
and can anyone explain to me what is this JAR file
tnx

CornedBee
Jul 28th, 2003, 05:12 AM
I have a Java source code in a form of an Executable Jar File.

I doubt it. You probably have java byte code in a jar file. If it was the source then the jar is not executable, unless it's both, which would be a waste.

JAR (the Java ARchive) is a ZIP-derived compressed file format. It is exactly like ZIP with an added manifest file (which contains information about the file in a machine- and human-readable format, key-value pairs). The manifest file might for example specifiy the startup class when the jar file is "executed".

You can use JAR for everything (Mozilla uses it for packaging components), but the original purpose was for packing up various .class and resource files for a Java application.



Now, if you want the source code you must first unpackage the jar (using a tool like WinRAR or PowerArchiver, or your own written using the classes in java.util.jar) and then you'll have to decompile the bytecode files (.class). To do so you need a java decompiler (see the "javap" thread).