ProfessionalCommunity Edition

Setting up your extension development environment manually

  • Last updated: April 14, 2025

  • Read time: 3 Minutes

You can set up your extension development environment to suit your preferences. This page covers the setup requirements and steps.

Note

If you want a faster setup, try our starter project. The project provides a ready-to-use template, so you can skip these steps and start coding immediately. For more information, see Setting up your extension development environment using the starter project.

Prerequisites

Before you begin, download a Java Integrated Development Environment (IDE). An IDE provides features like auto-completion and syntax highlighting to help streamline development.

We recommend using IntelliJ IDEA (Community Edition), a free Java IDE.

Step 1: Create a new project

Set up a new project in your IDE with the following details:

  • Project type: Select Gradle or Maven. These build systems manage dependencies, simplifying project setup. If your IDE doesn't let you create a Maven or Gradle project directly, create a Java project and configure it to use Maven or Gradle as the build system.

  • Language: Java.

  • Gradle DSL: If you're prompted to choose a Gradle DSL, you can select either Groovy or Kotlin. This only impacts how you configure Gradle - not your Java extension code.

  • Java version: Use version 21. Depending on your IDE, this configuration option may be labeled as something like JDK, SDK or JRE. Burp only supports extensions written in Java 21 or lower.

If you're prompted to choose a Gradle DSL, you can select either Groovy or Kotlin. This only impacts how you configure Gradle - not your Java extension code.

Step 2: Add the Montoya API dependency

Once your project is set up, add the Montoya API to your project's dependencies. Use the latest Montoya API version number, available from the releases page on GitHub.

Gradle configuration

To add the Montoya API in a Gradle project:

  1. Go to the Gradle build file.

  2. Add the following inside the dependencies section:

    • For a Gradle DSL build.gradle file:

      compileOnly "net.portswigger.burp.extensions:montoya-api:LATEST-VERSION"
    • For a Kotlin DSL build.gradle.kts file:

      compileOnly("net.portswigger.burp.extensions:montoya-api:LATEST-VERSION")
  3. Sync the Gradle changes.

Maven configuration

To add the Montoya API in a Maven project:

  1. Go to the pom.xml file.

  2. Add the following inside the dependency block:

    <dependency>     <groupId>net.portswigger.burp.extensions</groupId>     <artifactId>montoya-api</artifactId>     <version>LATEST-VERSION</version> </dependency>
  3. Update your Maven dependencies.

Step 3: Create your extension class

Create a Java class. This file will contain your extension code.

To create a new class file in your IDE:

  1. Right-click the folder where you want to keep your code, typically src > main > java.

  2. Select the option to create a new Java class. Depending on your IDE, this may be labeled as New > Java class or similar.

  3. Enter a name for the class. For example, Extension.

Once you've created the class file, update it with the following code. Make sure to replace YOUR-CLASS-NAME with the name of your class:

import burp.api.montoya.BurpExtension; import burp.api.montoya.MontoyaApi; public class YOUR-CLASS-NAME implements BurpExtension { @Override public void initialize(MontoyaApi montoyaApi) { // Add your code here } }

The initialize() method is called when Burp loads your extension. Add your code where indicated.

Related pages

For more information on the above code, see Understanding the starter project.

Confirming correct setup

To check that the project is correctly configured, attempt to build a JAR file. If the build is successful, you're ready to start writing.

For instructions, see Building a JAR file.

Was this article helpful?