I managed to delete the only up to date saved copy of an important Java project I had (I know, I know). I have the compiled .class files and I know it's possible to decompile them. Can anyone direct me to any references or anything to help me do this properly? FYI what I'm trying to decompile is the GUI project that Ezzaral and stultske helped me with a while back on these forums. I have an 'intermediate' saved version that is uploaded online, but it would take hours of work to get back to the current version, and more than that I don't want to risk corrupting current data by using different versions.

thanks for any help.

Recommended Answers

All 8 Replies

Hello,

I'm not sure but if you are looking for a decompiler. You can get one from here:
http://www.kpdus.com/jad.html

I have used it for my project as i misplaced java files. :P

Best of luck!

Well not so embarrassing, I remember another naive employee from my firm (you will not want to believe this one) actually SHREDDED the most recent copy of her project and she had conveniently forgotten to commit her code every night in our version control system.

So now back to the point, if you use a decompiler I do not know if your quality of code will remain the same, since there are chances that the java compiler might be performing optimisations on your code. My first option would be to try to recover the deleted data.
This would be possible if you are on Windows, there are quite few free and paid software available, Here are some free ones :-
http://www.aumha.org/a/recover.php
http://www3.telus.net/mikebike/RESTORATION.html
http://www.undelete-plus.com/files/

If you are lucky you will get your project back without decompiling.

@BestJewSinceJC : While it is certainly possible to decompile class files and you would certainly get several decompilers, one of which is the DJ Java decompiler, I would like to point out a thing here. The source code thus obtained would not be an exact copy of your .java file. Variable names would be changed and even the constructs used for looping might be changed (this is a personal expierience, my while loop was changed to a do-while loop) which would though certainly not change the logic of the program but make it quite complex in figuring out what you've written previously, when you need to make any further additions to your program in the future. While on the other side when you do make these changes by hand you would certainly have an original copy of the source code with you at all times for future needs.
All this to make a point that though decompiling is an option, I would rather prefer to make the changes by hand if I have the changed logic and the corresponding langauge changes quite clearly in my mind.
This is the thing every developer dreads, all the best for whatever option you choose.

EDIT : stephen84s has suggested a good option too... Hope you are on windows and hope you don't have to take any of the 'decompile' or 'write changes again' option....

If your project was set up in Eclipse, the "Restore from Local History" option might work out for you; it's worth a try.

Hey BestJewSinceJC,
I am a tech at a computer store and I have used
http://www.undelete-plus.com/ I highly recommend it!
Just as stephen84s has.

Good Luck I hope you get your stuff back!

Sorry, I should have elaborated further. I actually re-installed Windows Vista, thinking that I had all of my Java projects uploaded to my school's server as a backup. I was correct, except that my MOST important project wasn't a school project, so its not on their server, and it is a project I need. Will I still be able to recover deleted files using any of the tools given in this thread? And, if not, I don't really mind decompiling... as long as it is guaranteed to do the same thing. My project is practically finished and only minor updates will be necessary from this point on, so I'm not too worried about different loop structures, variable names, etc.

Sorry, I should have elaborated further. I actually re-installed Windows Vista, thinking that I had all of my Java projects uploaded to my school's server as a backup. I was correct, except that my MOST important project wasn't a school project, so its not on their server, and it is a project I need. Will I still be able to recover deleted files using any of the tools given in this thread? And, if not, I don't really mind decompiling... as long as it is guaranteed to do the same thing. My project is practically finished and only minor updates will be necessary from this point on, so I'm not too worried about different loop structures, variable names, etc.

Yes, as verruckt24 said and as i know from my experience. It will do same working as before.

Alright, thank you everyone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.