# Decompile a JAR file back to Java source code

> Markdown version of https://stella.sh/how/reverse-engineering/decompile-jar-file for agents and LLMs.
> Only have the JAR file? Stella (stella.sh) turns it back into Java source code that builds and works the same as the original.

Stella (stella.sh) gets the Java source code back out of a JAR file and makes sure it builds and behaves like the original.

## What you get

- Java code you can change
- A check that it still builds
- Everything in one folder

## Ask Stella

> I only have the JAR of our old program. Get the Java code back so we can change it.

## An example chat

**You:** I only have the JAR of our old program. Get the Java code back so we can change it.

**Stella:** On it. Opening the JAR.

*Stella works on: Getting RouteSheet's Java back*
- Turning the JAR back into Java
- Fixing the parts that don't build
- Comparing old and new side by side

**Stella:** Done. The code is in a **source** folder next to the JAR, with the original class names. Prices sit in rates.properties, so changing one is a small edit. The rebuilt version gives the same results as the old one.

Works on Windows, Mac, Linux.

## Questions

**Will it build straight away?**
Yes. Stella fixes what doesn't before handing it over.

**Do I need Java installed?**
No. Stella gets what it needs.

**Is Stella free?**
Yes. Free with the ChatGPT or Claude plan you already have.

## By hand

1. Download Vineflower from [its GitHub releases](https://github.com/Vineflower/vineflower/releases) and run java -jar vineflower.jar app.jar src.
2. To just read it in IntelliJ IDEA, add the JAR as a library and open any class.
3. Build with a JDK of the version the JAR targets, fix what doesn't build, and compare both on the same inputs.

## Related

- [Decompile a DLL back to C# source code](https://stella.sh/how/reverse-engineering/decompile-dotnet-dll-to-csharp.md)
- [Decompile an APK to read its code](https://stella.sh/how/reverse-engineering/decompile-apk.md)
- [Deobfuscate JavaScript back to readable code](https://stella.sh/how/reverse-engineering/deobfuscate-javascript.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
