background: A few days ago in the development of the project encountered a problem, that is, the use of myeclipse prepared a project packaged into jar After the upload deployment to the server, the local project was changed to change to some problems, think of uploading to the server inside the war package download and reuse, everyone knows, war java The file has been compiled into class file, the beginning of the period is a section named " jd-gui jad can be completely done (it is not important, Here's the point).
Jd_gui Network disk:http://pan.baidu.com/s/1skSxgDn(do not want to batch can download this directly)
Click save Source in the file
Jad official website:http://www.varaneckas.com/jad( Download According to your computer system )
I am using windows, such as:
Java jad download down after the decompression has two files, an exe file and a Help file, for the convenience of use, I directly will exe file in the JDK bin directory, this is done to be able to execute the exe file (no more environment variables inside the configuration), as to how to configure, I will be introduced in the next article.
After placing the jdkde Bin directory, we open cmd (shortcut: windows+r, input cmd):
Click OK.
then type inside:jad.exe-r-D c:\src-s java-8 Classes/**/*.class
where -r means to restore the directory structure of the source file,-ff indicates that the class attribute definition is placed before the class method definition,-D for the output directory,-s for the file extension , 8 toprevent garbled problems .
and then enter, you'll find a very strange phenomenon,
indicates that the specified file could not be found, this is certainly the case, because the C tray file above your computer does not have src This file, and there is no corresponding directory to execute the classes file, so will error, very normal.
For example, the first thing to do is to create a src in the C -disk directory ( which can be customized, but for the sake of our C - disk Example ) ,
Then copy the classes file that needs to be recompiled (including all the sub-files) in the root directory (which is the same directory as the SRC) .
This classes is what we want to decompile all the class files, and then execute this statement, you will find a bunch of English. Similar to this.
This means that the compilation succeeds, and then you can see in SRC that the class has been compiled into java and then saved to the appropriate folder.
I hope I can help you.
How to decompile a class into a Java file via Jad