Skip to content

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:

apt-search.sh
sudo apt search jadx

Output:

apt-result.txt
Sorting... Done
Full Text Search... Done

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

  1. No package manager support: Your distribution doesn’t have JADX in its repositories
  2. Latest features: You want unreleased features from the main branch
  3. Custom modifications: You need to modify JADX for specific use cases
  4. Learning: You want to understand how JADX works internally
  5. Offline environments: You need to build without internet access after initial clone

Prerequisites

Before building, ensure you have Java and Git installed.

On Ubuntu

install-prerequisites-ubuntu.sh
sudo apt update
sudo apt install openjdk-17-jdk git

Verify Java:

check-java.sh
java -version

Output:

java-version.txt
openjdk version "17.0.9" 2023-10-17
OpenJDK 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:

  1. Java JDK 17+: From Adoptium or Oracle
  2. Git for Windows: From git-scm.com

After installation, open Git Bash and verify:

check-java-windows.sh
java -version
git --version

Cloning the Repository

First, I cloned the JADX repository:

clone-jadx.sh
cd ~
git clone https://github.com/skylot/jadx.git

Output:

clone-output.txt
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 39389
Receiving objects: 100% (45231/45231), 25.43 MiB | 12.31 MiB/s, done.
Resolving deltas: 100% (26154/26154), done.

Navigate into the project:

cd-jadx.sh
cd jadx

Building 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

gradle-build.sh
./gradlew build

On Windows (Git Bash or Command Prompt):

gradle-build-windows.sh
gradlew.bat build

The first run took a while because Gradle downloaded dependencies:

build-output.txt
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 27s

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

find-scripts.sh
ls -la build/jadx/bin/

Output:

bin-contents.txt
total 24
drwxr-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.bat

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

test-jadx.sh
./build/jadx/bin/jadx --version

Output:

version-output.txt
jadx 1.5.1-SNAPSHOT

The build worked. Now I could decompile files:

decompile-test.sh
./build/jadx/bin/jadx myapp.jar

Adding to PATH

Typing the full path every time is tedious. I added JADX to my PATH:

add-to-path.sh
export PATH=~/jadx/build/jadx/bin:$PATH

Now I can run it directly:

run-directly.sh
jadx --version
jadx-gui myapp.jar

Making PATH Permanent

To make this change persist across sessions, I added it to my shell configuration.

For Bash:

bashrc.sh
echo 'export PATH=~/jadx/build/jadx/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

For Zsh:

zshrc.sh
echo 'export PATH=~/jadx/build/jadx/bin:$PATH' >> ~/.zshrc
source ~/.zshrc

On Windows, add the path to your Environment Variables:

  1. Open System Properties > Environment Variables
  2. Edit the Path variable
  3. 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:

execution-policy.ps1
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Running JADX

From Command Prompt:

jadx-cmd.bat
cd C:\Users\YourName\jadx
build\jadx\bin\jadx.bat --version

From PowerShell:

jadx-powershell.ps1
.\build\jadx\bin\jadx.bat --version

GUI on Windows

The GUI requires a display:

launch-gui-windows.sh
.\build\jadx\bin\jadx-gui.bat myapp.jar

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

skip-tests.sh
./gradlew build -x test

Clean Build

To start fresh:

clean-build.sh
./gradlew clean build

Verbose Output

For debugging build issues:

verbose-build.sh
./gradlew build --info

Specific Tasks

List available tasks:

list-tasks.sh
./gradlew tasks

Build only the CLI:

build-cli.sh
./gradlew :jadx-cli:build

Understanding the Project Structure

JADX is a multi-module Gradle project:

project-structure.txt
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.bat

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

java-version-error.txt
Unsupported class file major version 61

Install a newer JDK and set JAVA_HOME:

set-java-home.sh
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

Permission Denied

If the scripts aren’t executable:

fix-permissions.sh
chmod +x build/jadx/bin/*

Out of Memory

Large JAR files may cause memory issues. Increase the heap:

increase-memory.sh
export JAVA_OPTS="-Xmx4g"
jadx large-app.jar

Gradle Download Issues

If Gradle wrapper download fails, download Gradle manually:

manual-gradle.sh
wget https://services.gradle.org/distributions/gradle-8.4-bin.zip
unzip gradle-8.4-bin.zip
./gradle-8.4/bin/gradle build

Updating JADX

To get the latest changes:

update-jadx.sh
cd ~/jadx
git pull origin master
./gradlew clean build

When 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

Alternative Installation Methods

On macOS, Homebrew provides JADX:

brew-install.sh
brew install jadx

On some Linux distributions, Snap or Flatpak might have it:

snap-install.sh
sudo snap install jadx

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

  1. Clone the repository: git clone https://github.com/skylot/jadx.git
  2. Build with Gradle wrapper: ./gradlew build
  3. Find executables in build/jadx/bin/
  4. 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