Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to make jar file to .java ?
Posted

That's called reverse engineering, you may, for instance, Google for: "reverse engineering jar files"[^].
 
Share this answer
 
v2
It depends.

A jar file is just an archive. A normal distribution would only contain class files and may also include the javadoc.
When building a jar for a solution it is possible to include the java files as well, for debugging purposes. You'll find this is the case with most, if not all, of the classes in the core api. As an example in netbeans I can navigate to the source for the String class; try this yourself.

If the jar only contains the class files then the process is much harder, but not impossible. Using reflection you can extract the signatures for all the methods but the hard part is decoding the byte code. That I will leave as an exercise for the reader.
 
Share this answer
 
The above answer is right, you can extract JAR file but it only contains class files but you can convert it to .java if you want using Java Decompiler.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900