How to Install and Build JADX on Ubuntu and Windows
Problem
I needed JADX for reverse engineering work on my Ubuntu server, but apt didn’t have it and I wanted to build from source anyway. On Windows, I faced the same situation. Here’s what I tried:
sudo apt search jadxOutput:
Sorting... DoneFull Text Search... DoneNo package available. I could download a pre-built release, but I wanted to understand the build process and potentially contribute back to the project. Building from source was the way to go.
Environment
- Ubuntu 22.04 LTS (also tested on Windows 10/11 with Git Bash)
- Java JDK 11 or higher
- Git
Why Build from Source
You might want to build JADX from source when:
- No package manager support: Your distribution doesn’t have JADX in its repositories
- Latest features: You want unreleased features from the main branch
- Custom modifications: You need to modify JADX for specific use cases
- Learning: You want to understand how JADX works internally
- Offline environments: You need to build without internet access after initial clone
Prerequisites
Before building, ensure you have Java and Git installed.
On Ubuntu
sudo apt updatesudo apt install openjdk-17-jdk gitVerify Java:
java -versionOutput:
openjdk version "17.0.9" 2023-10-17OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-1ubuntu222.04)OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-1ubuntu222.04, mixed mode, sharing)On Windows
Download and install:
- Java JDK 17+: From Adoptium or Oracle
- Git for Windows: From git-scm.com
After installation, open Git Bash and verify:
java -versiongit --versionCloning the Repository
First, I cloned the JADX repository:
cd ~git clone https://github.com/skylot/jadx.gitOutput:
Cloning into 'jadx'...remote: Enumerating objects: 45231, done.remote: Counting objects: 100% (5842/5842), done.remote: Compressing objects: 100% (1652/1652), done.remote: Total 45231 (delta 4123), reused 5489 (delta 3871), pack-reused 39389Receiving objects: 100% (45231/45231), 25.43 MiB | 12.31 MiB/s, done.Resolving deltas: 100% (26154/26154), done.Navigate into the project:
cd jadxBuilding with Gradle
JADX uses Gradle for building. The project includes a Gradle wrapper, so you don’t need to install Gradle separately.
The Build Command
./gradlew buildOn Windows (Git Bash or Command Prompt):
gradlew.bat buildThe first run took a while because Gradle downloaded dependencies:
Downloading https://services.gradle.org/distributions/gradle-8.4-bin.zip... gradle download progress ...
> Task :jadx-core:compileJava> Task :jadx-core:processResources> Task :jadx-core:classes> Task :jadx-core:jar> Task :jadx-cli:compileJava> Task :jadx-cli:processResources> Task :jadx-cli:classes> Task :jadx-cli:jar> Task :jadx-gui:compileJava...
BUILD SUCCESSFUL in 3m 27sThe build created several artifacts in the build/ directory.
Finding the Executables
After a successful build, I needed to find where JADX put the executable scripts. I checked the build output:
ls -la build/jadx/bin/Output:
total 24drwxr-xr-x 2 root root 4096 Mar 26 10:30 .drwxr-xr-x 3 root root 4096 Mar 26 10:30 ..-rwxr-xr-x 1 root root 11234 Mar 26 10:30 jadx-rwxr-xr-x 1 root root 5678 Mar 26 10:30 jadx.bat-rwxr-xr-x 1 root root 9876 Mar 26 10:30 jadx-gui-rwxr-xr-x 1 root root 4567 Mar 26 10:30 jadx-gui.batJADX provides two interfaces:
- jadx: Command-line interface for scripting and automation
- jadx-gui: Graphical interface for interactive analysis
The .bat files are for Windows, the shell scripts for Unix-like systems.
Running JADX
Quick Test
I tested the build by running JADX with the --version flag:
./build/jadx/bin/jadx --versionOutput:
jadx 1.5.1-SNAPSHOTThe build worked. Now I could decompile files:
./build/jadx/bin/jadx myapp.jarAdding to PATH
Typing the full path every time is tedious. I added JADX to my PATH:
export PATH=~/jadx/build/jadx/bin:$PATHNow I can run it directly:
jadx --versionjadx-gui myapp.jarMaking PATH Permanent
To make this change persist across sessions, I added it to my shell configuration.
For Bash:
echo 'export PATH=~/jadx/build/jadx/bin:$PATH' >> ~/.bashrcsource ~/.bashrcFor Zsh:
echo 'export PATH=~/jadx/build/jadx/bin:$PATH' >> ~/.zshrcsource ~/.zshrcOn Windows, add the path to your Environment Variables:
- Open System Properties > Environment Variables
- Edit the
Pathvariable - Add
C:\Users\YourName\jadx\build\jadx\bin
Windows-Specific Notes
On Windows, I encountered a few differences:
Execution Policy
PowerShell might block script execution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserRunning JADX
From Command Prompt:
cd C:\Users\YourName\jadxbuild\jadx\bin\jadx.bat --versionFrom PowerShell:
.\build\jadx\bin\jadx.bat --versionGUI on Windows
The GUI requires a display:
.\build\jadx\bin\jadx-gui.bat myapp.jarIf you’re using WSL (Windows Subsystem for Linux), the GUI works if you have an X server installed like VcXsrv or WSLg.
Build Options
The Gradle build supports several useful options.
Skip Tests
For faster builds, skip the test suite:
./gradlew build -x testClean Build
To start fresh:
./gradlew clean buildVerbose Output
For debugging build issues:
./gradlew build --infoSpecific Tasks
List available tasks:
./gradlew tasksBuild only the CLI:
./gradlew :jadx-cli:buildUnderstanding the Project Structure
JADX is a multi-module Gradle project:
jadx/├── jadx-core/ # Core decompilation logic├── jadx-cli/ # Command-line interface├── jadx-gui/ # Graphical interface├── jadx-plugins/ # Plugin extensions└── build/ # Build output └── jadx/ └── bin/ # Executable scripts ├── jadx ├── jadx.bat ├── jadx-gui └── jadx-gui.batUnderstanding this structure helps when you need to modify specific components.
Troubleshooting Common Issues
Java Version Mismatch
JADX requires Java 11 or higher. If you see this error:
Unsupported class file major version 61Install a newer JDK and set JAVA_HOME:
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64Permission Denied
If the scripts aren’t executable:
chmod +x build/jadx/bin/*Out of Memory
Large JAR files may cause memory issues. Increase the heap:
export JAVA_OPTS="-Xmx4g"jadx large-app.jarGradle Download Issues
If Gradle wrapper download fails, download Gradle manually:
wget https://services.gradle.org/distributions/gradle-8.4-bin.zipunzip gradle-8.4-bin.zip./gradle-8.4/bin/gradle buildUpdating JADX
To get the latest changes:
cd ~/jadxgit pull origin master./gradlew clean buildWhen to Use Pre-built Releases vs Building
Use pre-built releases when:
- You just need JADX as a tool
- You want stable, tested versions
- Quick setup is important
Build from source when:
- You need the latest unreleased features
- You want to customize JADX
- Your platform has no pre-built binaries
- You’re contributing to the project
Related Knowledge
Alternative Installation Methods
On macOS, Homebrew provides JADX:
brew install jadxOn some Linux distributions, Snap or Flatpak might have it:
sudo snap install jadxGradle Wrapper Explained
The gradlew script (Gradle Wrapper) ensures everyone uses the same Gradle version. It downloads Gradle automatically, so you don’t need to install it globally. The wrapper configuration is in gradle/wrapper/gradle-wrapper.properties.
Summary
In this post, I showed how to build JADX from source on Ubuntu and Windows. The key steps are:
- Clone the repository:
git clone https://github.com/skylot/jadx.git - Build with Gradle wrapper:
./gradlew build - Find executables in
build/jadx/bin/ - Add to PATH for convenient access
Building from source gives you the latest features and allows customization. The Gradle wrapper handles dependencies, making the process straightforward once you have Java installed.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments