Extract source code from .jar file

后端 未结 11 933
名媛妹妹
名媛妹妹 2020-11-28 17:42

Is there a way to extract the source code from an executable .jar file (Java ME)?

相关标签:
11条回答
  • 2020-11-28 18:20

    Above tools extract the jar. Also there are certain other tools and commands to extract the jar. But AFAIK you cant get the java code in case code has been obfuscated.

    0 讨论(0)
  • 2020-11-28 18:20

    suppose your JAR file is in C:\Documents and Settings\mmeher\Desktop\jar and the JAR file name is xx.jar, then write the below two commands in command prompt:

    1> cd C:\Documents and Settings\mmeher\Desktop\jar

    2> jar xf xx.jar

    0 讨论(0)
  • 2020-11-28 18:24

    -Covert .jar file to .zip (In windows just change the extension) -Unzip the .zip folder -You will get complete .java files

    0 讨论(0)
  • 2020-11-28 18:28

    Use JD GUI. Open the application, drag and drop your JAR file into it.

    0 讨论(0)
  • 2020-11-28 18:28

    You can extract a jar file with the command :

    jar xf filename.jar
    

    References : Oracle's JAR documentation

    0 讨论(0)
  • 2020-11-28 18:30

    Steps to get sources of a jar file as a zip :

    1. Download JD-GUI from http://java-decompiler.github.io/ and save it at any location on your system.

    2. Drag and drop the jar or open .jar file for which you want the sources on the JD.

    3. Java Decompiler will open with all the package structure in a tree format.

    4. Click on File menu and select save jar sources. It will save the sources as a zip with the same name as the jar.

    Example:-

    We can use Eclipse IDE for Java EE Developers as well for update/extract code if require.

    From eclipse chose Import Jar and then select jar which you need. Follow instruction as per image below

    0 讨论(0)
提交回复
热议问题