Reputation: 1144
We accidently got some JAVA source files deleted from the system.
This happened when We checked out a folder from repository directly as an eclipse project and then tried to copy a folder from another eclipse project into this one.Strangely all those folder files have vanished from local system (and obviously they never made it to SVN repository).
Somehow We have obtained .svn-base files for some CLASS files.Now We are trying to decompile class files to obtain the source code back. However some of the class files are giving error "invalid input file" when jd compiler is trying to process them. Is there any other solution to this ?
Upvotes: 1
Views: 14463
Reputation: 2213
I also had the error "invalid input file" with a certain class file. I was using version 0.3.6 of jd-gui. After downloading the newest version of jd-gui (which was 1.6.6 at the moment of writing this) I could decompile the class file which previously failed.
So if someone still has this problem it makes sense to check the version and upgrade if it is an older one. Here is a link to the "Latest-Release"-download page: http://java-decompiler.github.io/
Upvotes: 0
Reputation: 15552
Try using JAD to decompile your files.
www.varaneckas.com/jad/
You may need to unzip your jar files and then run something like the following to decompile them all
find <srcdirectory> -name *.class -exec jad -s .java -r -ff -clear -debug -d <dest directory> {} \;
I havent tested the above command but hopefully it is almost there...
Upvotes: 0
Reputation: 718826
From what I can tell, "jd-gui" is closed source, so you may need to contact the developer to find out what that message means. (If it was open source, we could just look at the source code to figure out what the likely problem was!)
However, one thing is clear from various questions that Google shows up, and that is that "jd-gui" doesn't understand how to decompile archives (JAR, EAR, etc). So maybe you just need to un-JAR something to make it work.
The other thing you could try (first) is to see what "javap" makes of the class files that "jd-gui" doesn't like.
Upvotes: 3