How to Get Source Code for Blue Term 2

11 Answers 11

Reset to default

Introducing: Trending sort

You can now choose to sort by Trending, which boosts votes that have happened recently, helping to surface more up-to-date answers.

Trending is based off of the highest score sort and falls back to it if no posts are trending.

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

user avatar

Raekye

4,943 8 gold badges 46 silver badges 74 bronze badges

answered Feb 24, 2011 at 16:08

user avatar

3

  • is there a way to get source code from .jar without JD GUI ?

    Oct 7, 2016 at 5:24

  • @ZulqurnainJutt use as mentioned in @elachance's answer jar xf filename.jar

    Sep 14, 2018 at 4:45

  • This is the best solution.

    Apr 14 at 4:04

user avatar

Jeromy French

11.5k 19 gold badges 72 silver badges 127 bronze badges

answered Sep 24, 2012 at 16:18

user avatar

3

  • This is equivalent to renaming filename.jar to filename.jar.zip and then just unzipping it.

    Mar 5, 2014 at 9:16

  • This doesn't extract the source code. It extracts the compiled source code.

    Jul 22, 2015 at 20:35

  • @caffinatedmonkey it does extract source code when the jar contains java files, e.g. jars with names typically ending in "-sources". It indeed does only extract .class files when the jar does not contain any java source files.

    May 2, 2016 at 9:04

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

user avatar

answered May 19, 2013 at 8:20

user avatar

3

  • @Nitesh... I will be posting the link hosted on my website... please download it from there

    Aug 28, 2013 at 11:28

  • The version in the techieme link works beautifully, thank you!

    Jul 28, 2015 at 15:59

  • After saving all sources, when I open the Java files, it shows all the lines as commented lines. Is there any setting to fix that?

    Jul 23, 2020 at 10:39

Your JAR may contain source and javadoc, in which case you can simply use jar xf my.jar to extract them.

Otherwise you can use a decompiler as mentioned in adarshr's answer:

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

user avatar

Kranthi Sama

488 2 gold badges 10 silver badges 27 bronze badges

answered Feb 24, 2011 at 16:17

user avatar

1

  • Note that .jar files are actually .zip files and can be opened with any ZIP tool.

    Feb 24, 2011 at 17:50

I know it's an old question Still thought it would help someone

1) Go to your jar file's folder.

2) change it's extension to .zip.

3) You are good to go and can easily extract it by just double clicking it.

Note: I tested this in MAC, it works. Hopefully it will work on windows too.

answered Feb 12, 2014 at 12:26

user avatar

4

  • @JCodex, I'm doing a research project on the sentiment analysis tool "opinionfinder" and its jar does indeed contain both java AND class files. so your comment is not 100% true. I know it would usually contain only .class but not in this case at least

    Mar 4, 2015 at 10:36

  • Your solution will only extract .class files not the source code.

    Sep 1, 2017 at 9:46

  • Seems JD-GUI is a multi-platform tool that actually decompiles the code and shows the source code for classes in all packages. I tried it and could get the source code in a second in MacOS. I have Java 8 installed . You can get it on jd.benow.ca Not sure if it works for large projects.

    Sep 1, 2017 at 10:03

  • need source code which is not provide by the way you described

    Jun 28, 2019 at 10:53

Do the following on your linux box where java works (if u like the terminal way of doing things)

                                  cd ~     mkdir decompiled_code && cd decompiled_code //  download jar procyon from https://drive.google.com/file/d/1yC2gJhmLoyE8royCph5dLEncgkNZXj58/view?usp=sharing     java -jar procyon-decompiler-0.5.36.jar /Path/to/your/jar -o .                              

NOTE : as @Richard commented "this may be illegal depending on whether you own the copyright to the jar, the country you live in and your purpose for doing it."

answered Nov 5, 2019 at 13:04

user avatar

1

  • For a specific class file you can do java -jar procyon-decompiler-0.5.36.jar /Path/to/your/jar package/of/the/java/class.class > className.java

    Jan 6, 2021 at 6:40

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:-

enter image description here

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

enter image description here

enter image description here

answered Nov 3, 2020 at 18:00

user avatar

AndroChef Java Decompiler produces very good code that you can use directly in your projects...

answered May 3, 2014 at 2:59

user avatar

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.

answered Mar 4, 2014 at 9:49

user avatar

1

  • The greatest answer

    Jul 8, 2016 at 6:19

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

answered Jan 31, 2014 at 11:18

user avatar

0

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

answered May 12, 2017 at 18:37

user avatar

2

  • As a small note on this method... It is true that jar files are fancy zip files. However, unziping a jar will most likely yield *.class files, that is "compiled" java files. It is possible to "decompile" class files to normal java files. This functionality is included in many IDEs

    May 21, 2018 at 13:38

  • this will just unlock class files

    Feb 21, 2019 at 11:06

Not the answer you're looking for? Browse other questions tagged java jar java-me decompiling or ask your own question.

rodriguezlietund.blogspot.com

Source: https://stackoverflow.com/questions/5107187/extract-source-code-from-jar-file

0 Response to "How to Get Source Code for Blue Term 2"

إرسال تعليق

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel