Skip to main content
This guide covers how to build Ghidra from source code for development purposes.

Prerequisites

Required Build Tools

Before building Ghidra, ensure you have the following tools installed:
  • Version: JDK 21 64-bit
  • Download: Eclipse Temurin
  • Verify installation: java -version
  • Version: Gradle 8.5 or later
  • Download: Gradle releases
  • Alternative: Use the provided Gradle wrapper if Internet connection is available
  • Verify installation: gradle --version
  • Version: 3.9 to 3.13 with bundled pip
  • Download: Python downloads
  • Verify installation: python3 --version and pip3 --version

Platform-Specific Requirements

Required native build tools:
  • GCC or Clang compiler
  • make
Install on Ubuntu/Debian:
Install on Fedora/RHEL:

Getting the Source Code

Option 1: Download ZIP Archive

Option 2: Clone the Repository

Cloning the repository is recommended if you plan to contribute changes back to the project.

Build Process

Step 1: Download Dependencies

Download non-Maven Central dependencies. This creates a dependencies directory in the repository root:
If you didn’t install Gradle system-wide, you can use the Gradle wrapper instead:
  • Linux/macOS: ./gradlew -I gradle/support/fetchDependencies.gradle
  • Windows: .\gradlew.bat -I gradle/support/fetchDependencies.gradle

Step 2: Prepare Development Environment

Download Maven Central dependencies and setup the repository for development. By default, these will be stored at $HOME/.gradle/:

Step 3: Build Ghidra

Create a compressed development build:
The compressed development build will be located at build/dist/.
The build created this way is intended only to run on the platform on which it was built.

Alternative Build Options

Build Uncompressed Distribution

Build Ghidra to build/dist in an uncompressed form:

Build Native Components Only

Build native components for your current platform (requires native tool chains):

Compile Sleigh Files

Manually compile sleigh files (Ghidra will also do this at runtime when necessary):

Build Documentation

Generate Javadoc documentation:

Build Python Packages

Build Python3 packages for PyGhidra and the Debugger:

Common Gradle Commands

Clean Build Files

Clean up repository build files (may be necessary after a git pull to fix unexplainable compilation errors):

Skip Specific Tasks

You can skip certain Gradle tasks to speed up your build using the -x <task> argument:

Generate Eclipse Project Files

Generate nested Eclipse project files for import:

Offline Development

To move the Ghidra repository to an offline network and continue development:
The -g flag specifies the Gradle user home directory. Overriding it to be inside the Ghidra repository ensures all Maven Central dependencies are moved with the rest of the repository.

Testing Your Build

Run Unit Tests

Run Integration Tests

Run All Tests and Generate Report

Headless Testing (CI/Docker)

For running tests in headless mode on Linux, in a CI environment, or in Docker:
This is required to make AWT happy in headless environments.

Next Steps

After successfully building Ghidra:
  1. See the Development Setup guide to configure your IDE
  2. Review the Contributing Guide to learn how to submit changes
  3. Check the Troubleshooting guide if you encounter issues