Extract source code from .jar file

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


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


You can extract a jar file with the command :

jar xf filename.jar

References : Oracle's JAR documentation


I believe this can be done very easily. You can always extract the source files (Java files) of a jar file into a zip.

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

  1. Download JAD from http://techieme.in/resources-needed/ and save it at any
    location on your system.
  2. Drag and drop the jar for which you want the sources on the JAD. 3 JAD UI will open with all the package structure in a tree format.
  3. Click on File menu and select save jar sources.
  4. It will save the sources as a zip with the same name as the jar.

Hope this helps.

The link is dead due to some reason so adding the link from where you can download the JDGUI