I was trying to save edits in my java program on my netbeans when the lights wents out. Now my .java document is completely empty. Not even the default class ClassName {}
declaration show. Everything's gone. The document had been preveously saved and I was actually only trying to save some edits. The lights went out right just when I hit Ctrl+s; that .000 something seconds when the document gets saved. Is there a way I can get the document back from my pc. It is the backbone class in my program. Thank you all in advance.
Asked
Active
Viewed 37 times
1

Xyz
- 5,955
- 5
- 40
- 58

Program-Me-Rev
- 6,184
- 18
- 58
- 142
-
1Backups? Version control system? – Thilo Sep 01 '14 at 04:23
-
2You're out of luck :-(. You can try looking for recovery tools for your operating system. If you have the .class compiled somewhere, you might disassemble it and write back the .java using your memory and the disassembled code. – Rafael Almeida Sep 01 '14 at 04:27
-
1Have you deployed it atleast once? You could use decompiler to get .java back – Jayan Sep 01 '14 at 05:17
-
Yes I have @Jayan. I'm still researching on how to go about disassembling, as per Rafael Almeida's suggestion. Could you please suggest how to go about it, (decompiling) in more detail please? – Program-Me-Rev Sep 01 '14 at 05:38
-
I found the answer [here](http://stackoverflow.com/questions/272535/how-do-i-decompile-java-class-files). Thanks so much for your amazing suggestions. You guys saved me hours in coding again what I'd already done before. Thanks a lot. I used [Java Decompiler](http://jd.benow.ca/). I used key words in your answers to go about a small research – Program-Me-Rev Sep 01 '14 at 05:54
-
Please do consider what Thilo wrote. You need a version control (preferably on different system). Consider git(I am biased). – Jayan Sep 01 '14 at 07:24
-
I don't know Netbeans, but Eclipse keeps old versions of all updated source files for some time. You can then "restore from local history". Maybe NB also has that. – Thilo Sep 02 '14 at 01:32