In this post, I'm going to show a method to covert class/classes/jar file to java file(s).
To do so, we are going to use a tool, JD-GUI. It is a Java Decompiler, which supports all versions of Java, including java-7.
Download the application from here, and extract it to a proper location.
Now, open the terminal (in case of Linux) and run the following command:
./jd-guiIt will open the GUI window of Java decompiler.
Just drag-and-drop a class/jar file into this window. In the left panel, we can find the corresponding java files, arranged in proper package format.
To save a single file, select it and choose "Save Source" from the top menu. And to save entire package, choose "Save all sources".
Troubleshooting:
You may ran into one of these problems, while trying to open jd-gui. Install the packages specified accordingly.
Error 1:
./jd-gui: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directorySolution:
sudo apt-get install libgtk2.0-0:i386Error 2:
./jd-gui: error while loading shared libraries: libXxf86vm.so.1: cannot open shared object file: No such file or directorySolution:
sudo apt-get install libxxf86vm1:i386Error 3:
./jd-gui: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directorySolution:
sudo apt-get install libsm6:i386Error 4:
/jd-gui: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directorySolution:
sudo apt-get install lib32stdc++6
Comments
Post a Comment