2

I made a big error and I need your help:

I work on a project for the school with java and I made a big error!

I sent to me only the *.class files and deleted the other files(I work in my school with VM).. Is there a way to compile these .class files to .java files?

Thanks

Steve
  • 7,171
  • 2
  • 30
  • 52
ciaodarwin
  • 483
  • 3
  • 7
  • 22
  • 3
    You're looking for a decompiler, not a compiler. Start by googling `java decompile`: https://www.google.com.au/search?q=java+decompiler . – paxdiablo May 27 '13 at 05:38

6 Answers6

3

You need to use decompiler for that not the compiler.

First decompile using decompiler and then do some changes what ever you needed and then again compile it.Than your problem will solve

SEE HERE

PSR
  • 39,804
  • 41
  • 111
  • 151
  • In places where JD-GUI fails, another decompiler may succeed. You may need more than one to restore all of your source code. Feel free to try [mine](https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler). Good luck! – Mike Strobel May 28 '13 at 19:06
2

Try the Java Decompiler. It should be able to reverse your .class files.

You can also try Show my code if you don't mind submitting your .class files online.

You should be aware that different decompilers may give different results, so trying different ones may be helpful. See Choose and test java decompiler

Community
  • 1
  • 1
Steve
  • 7,171
  • 2
  • 30
  • 52
  • Bizarre license on that JD-GUI one: Though it's "free for non-commercial use", it "may be freely used for personal needs in a commercial or non-commercial environments". Methinks the author may need to clean that up at some point. – paxdiablo May 27 '13 at 05:44
0

The utility you need is called java decompiler. There are several available.

Try JAD from command line. You can also install plugin for eclipse.

And BTW if you are on windows is it possible that your source files are in recycle bin? Or if you are using eclipse try to check the eclipse local history (right click on your project and choose "Restore from local history")

AlexR
  • 114,158
  • 16
  • 130
  • 208
0

You need to decompile your class file. But, after decompile you also need some necessary changes to get your original java file. Try this.

JDGuide
  • 6,239
  • 12
  • 46
  • 64
0

I preper using JD-GUI. You can download from link http://java.decompiler.free.fr/?q=jdgui

Ahmet Karakaya
  • 9,899
  • 23
  • 86
  • 141
0

Dont Worry download DJ Java Decompiler 3.7 download only this version.

KhAn SaAb
  • 5,248
  • 5
  • 31
  • 52