Search code examples
javagithubjardecompiling.class-file

How can I change all .class files in a jar(or folder) to .java (or .txt) at once?


I have always used this to decompile any .class file to readable format. However, now I need to change around 30-40 .class files to readable format to push to my github. How may I change all the .class files to readable (.java or .txt) at once?


Solution

    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 everything from your archive and save their sources into another zip file.

    You would then need to unzip the ZIP file, and add it to a git repo before push.