user2651804
user2651804

Reputation: 1614

converting .class into .java

I deleted a Java project from my hard disk in an attempt to do some refactoring with Eclipse. Luckily I found a recent version of an Executable Jar File and decrompressed it into a bunch of .class files. I've read some 'decompiling' threads on SO and tried showmycode.com, but I was hoping for more. Isn't it possible to convert .class files into the .java files that made them, comments included - nothing changed? Or find the in the .jar file? What are my best options if not? Other answers on the topic seem outdated. Do I need to download software?

Upvotes: 0

Views: 2058

Answers (1)

Scott Chamberlain
Scott Chamberlain

Reputation: 127543

You will not be able to get your comments back, they are lost when you go from .java to .class. As to how to do it any "Java Decompiler" can do it, your code will not be exactly what you wrote, however the code you get back will be functionally the same as what you originally wrote.

JD is a decompiler I have used before and have been happy with its output.

Upvotes: 3

Related Questions