Unless you also have the source code (either in the JAR, or separately), then the best you can do is to use a Java decompiler. Depending on how the code was compiled in the first place, this might generate source code which is significantly different to what the original author wrote (although functionally identical, of course). For example, certain optimizer options could result in loops being re-written and local variables being removed. Certain debug options could result in the names of local variables being removed, so the decompiler will have to invent (meaningless) names for them, etc.

I would also question whether what you want to do is legal. Generally, if a project is licensed for modification then its source code will be available and you won't need to do what you're proposing.

Answer from dty on Stack Overflow
🌐
Java Decompiler
java-decompiler.github.io
Java Decompiler
The “Java Decompiler project” ... browse the reconstructed source code with the JD-GUI for instant access to methods and fields. JD-Eclipse is a plug-in for the Eclipse platform....
Discussions

Java Decompiler in MyEclipse - Genuitec
Does MyEclipse supports decompiletion facility? I mean can we generate java code from a class file? Is there any way or plug-in? ... Not at this time, but there are plenty of Eclipse plugins that can install along side MyEclipse to accomplish this. I believe jadclipse is a popular one. ... ii) download jar ... More on genuitec.com
🌐 genuitec.com
January 18, 2007
Eclipse: How Do I decompile jar and load it as a project? - Stack Overflow
how can I decompile a jar and load it as a project in my Eclipse so I can modify the code ? fyi I have googled jar decompiler. Looking for a guide or any insight on experiences with it. More on stackoverflow.com
🌐 stackoverflow.com
Looking for a Java decompiler
I've had a good experience with this one: http://jd.benow.ca/ EDIT: You decompile the .class file, which is a compiled .java file. A .jar file may contain .java files as well. More on reddit.com
🌐 r/java
49
28
June 13, 2017
Java decompiler, open jar excecutable file in eclipse and see source code - Stack Overflow
I have downloaded Java decompiler jd-eclipse-2.0.0.zip and followed the steps to install it in eclipse. I want to open a jar executable file in eclipse to see its source code but I don't know h... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Eclipse Foundation
eclipse.org › community › eclipse_newsletter › 2017 › february › article8.php
The Features of Eclipse Class Decompiler | The Eclipse Foundation
Eclipse Class Decompiler integrates JD, Jad, FernFlower, CFR, Procyon seamlessly with the Eclipse IDE. It displays all the Java sources during your debugging process, even if you do not have them all.
🌐
Eclipse
genuitec.com › home › topics › myeclipse ide › feature requests › java decompiler in myeclipse
Java Decompiler in MyEclipse - Genuitec
January 18, 2007 - Does MyEclipse supports decompiletion facility? I mean can we generate java code from a class file? Is there any way or plug-in? ... Not at this time, but there are plenty of Eclipse plugins that can install along side MyEclipse to accomplish this. I believe jadclipse is a popular one. ... ii) download jar from wiki page above, and place in your ‘dropins’ folder of your myeclipse directory on Mac this is /Library/Genuitec/My Eclipse 7.5/dropins
🌐
Webner Blogs
blog.webnersolutions.com › home › eclipse – java decompiler (jd-eclipse)
Eclipse - Java decompiler (jd-eclipse) Webner Blogs - eLearning, Salesforce, Web Development & More
February 8, 2018 - If you are working with eclipse IDE, it provides many plugins and one of them is java decompiler. This plugin will decompile all your class files to give you Java source code. JD-Eclipse is a plug-in for the Eclipse platform.
Find elsewhere
🌐
Kreitech
kreitech.io › blog › eclipse-debug-java-program-without-source-code-jd-eclipse-and-realignment
Eclipse – Debug java program without source code – jd-eclipse and realignment
Install JD-Eclipse following the steps provided in the JD-Eclipse site (the process is quite simple) http://java.decompiler.free.fr/?q=jdeclipse ‍ · Restart Eclipse ‍ · Download Realignment realignment.jd.ide.eclipse_1.0.2.jar – https://sourceforge.net/projects/realignmentjd/files/ ‍ ·
🌐
Baeldung
baeldung.com › home › java › decompiling classes in java
Decompiling Classes in Java | Baeldung
August 14, 2025 - java -jar JDCommandLine.jar ${TARGET_JAR_NAME}.jar ./classes · Don’t leave off the ./classes parameter. It defines the output directory. After successful decompilation, we can access the source files contained in the output directory. They’re now ready to view through a text editor like Vim. We looked at decompilation in Eclipse ...
🌐
Eclipse Marketplace
marketplace.eclipse.org › content › enhanced-class-decompiler
Enhanced Class Decompiler | Eclipse Plugins, Bundles and Products - Eclipse Marketplace | Eclipse Foundation
Enhanced Class Decompiler integrates CFR, FernFlower, JD, Procyon, Vineflower seamlessly with Eclipse and allows Java developers to debug class files without source code directly.
🌐
Medium
medium.com › @dappfoundery › how-to-decompile-java-class-files-bf3705370bbd
How to Decompile Java Class Files | by Dapp Foundery Blogs | Medium
December 4, 2023 - After installing JD-Eclipse and restarting Eclipse, you’re all set to decompile Java class files. To do this: - Open any Java project in Eclipse. - Navigate to Maven dependencies or libraries to view the jar files included in your project.
🌐
Reddit
reddit.com › r/java › looking for a java decompiler
r/java on Reddit: Looking for a Java decompiler
June 13, 2017 -

I have a couple of .jar games on my disk. I want to decompile the bytecode back to the readable .java format.

What are my options? Google wasn't very helpful, throwing old sites at me with broken download links.

I just want to learn - I played the game lots of times so I know what it does, now I want to know how it does it.

EDIT: Thanks to everyone who replied, the post stays so that others can use. I decided to use jd-gui, but it's good to know many Java IDEs have plugins to do this too (I use Netbeans and I couldn't find a decompiler plugin for it)

🌐
Code2care
code2care.org › home page › java › java decompiler eclipse plugin
Java Decompiler Eclipse Plugin | Code2care
1 week ago - How to decompile your Java classes and jars using Java Decompiler Eclipse Plugin.
🌐
Mkyong
mkyong.com › home › java › how to decompile class in java
How to decompile class in Java - Mkyong.com
July 1, 2021 - We no need to install or configure anything, just clicks on the Java class or method, clicks CTRL + B (declaration or usages) or CTRL + ALT + B (implementation), IntelliJ IDEA will automatically decompile the Java class.
🌐
JetBrains
plugins.jetbrains.com › plugin › 7100-java-decompiler
Java Decompiler - IntelliJ IDEs Plugin | Marketplace
JD-IntelliJ is a Java decompiler for the IntelliJ IDEA. Open a Java class file to see the decompiled code. It is based on the famous JD-GUI's core library JD-Core...
🌐
Uprootsecurity
uprootsecurity.com › blog › decompile-jar-files-java-guide
How to Decompile JAR Files: Guide for Java Developers
July 7, 2025 - Eclipse users can quickly enable JAR decompilation with the Enhanced Class Decompiler plugin.
🌐
GitHub
github.com › java-decompiler › jd-eclipse
GitHub - java-decompiler/jd-eclipse: A Java Decompiler Eclipse plugin
JD-Eclipse, a Java decompiler plug-in for the Eclipse platform.
Starred by 726 users
Forked by 224 users
Languages   Java
🌐
GitHub
github.com › mchr3k › jdeclipse-realign › issues › 16
Decompiler does not work with JARs within Eclipse Debugger · Issue #16 · mchr3k/jdeclipse-realign
When I set a breakpoint within a JAR of a Maven dependency of a project and afterwards debug that project, the debugger will not show the decompiled source of the Maven dependency when stepping through the code. Also I cannot I cannot evaluate new expressions. I don't know though, whether this problem can be fixed in jdeclipse-realign, or whether it is the problem in m2e described here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=384065.
🌐
Mkyong
mkyong.com › home › java › java decompiler plugin for eclipse ide
Java decompiler plugin for Eclipse IDE - Mkyong.com
June 29, 2021 - In Eclipse IDE, we can use Enhanced Class Decompiler plugin to decompile Java class files without source code directly.
🌐
Stack Overflow
stackoverflow.com › questions › 62023105 › java-decompiler-open-jar-excecutable-file-in-eclipse-and-see-source-code
Java decompiler, open jar excecutable file in eclipse and see source code - Stack Overflow
Note that decompilers don't show you the original source code. What you get may still be quite hard to read. ... Unzip the .jar file. (A jar file is really a zip file), and then open the .class files in eclipse.