Search code examples
javadecompiling

Batch decompiling of Java files with JD-GUI


I'm looking for a program to batch decompile Java classes. I found JAD, but it didn't support some new features of Java, and the benefit of this program is that it can execute from command line and generate a *.java file automatically.

I also found JD-GUI. It supports most features of Java, but the shortcoming is that it can't do batch processing. You need to open the class file with the program and click save.

Is there a way to make JD-GUI do batch processing like JAD?


Solution

  • Command line decompilation for JD-GUI is a highly requested feature but it's not implemented yet. Perhaps you can use the following workaround in the meantime:

    1. jar (or zip) all the classes you want decompiled together.
    2. Launch JD-GUI and open your jar (zip) archive.
    3. Use "File" - "Save JAR Sources" menu option. It will decompile all classes from your archive and save their sources into another zip file.

    I haven't seen any good open source JD-GUI alternatives with command-line support, unfortunately, so I think the above is as good as it gets for now.