File: building-zap-with-intellij-idea.md | Updated: 11/18/2025
This guide explains how to make changes to ZAP using IntelliJ IDEA.
You will need to have followed the Quick Start Guide to Building ZAP and installed a version of IntelliJ IDEA .
Follow the instructions on https://projectlombok.org/setup/intellij
Working with ZAP in IntelliJ IDEA may need a bit more Java resources for the Gradle actions. To adjust how much memory Gradle can use on your machine set the option in gradle.properties
For Linux/OSX
echo 'org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g' >> ~/.gradle/gradle.properties
For Windows
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> %USERPROFILE%\.gradle\gradle.properties
On the welcome screen of IntelliJ IDEA, click on âNew Projectâ.

Then, in the âNew Projectâ window, with âEmpty Projectâ as automatically selected, choose a Project name (e.g. âZAP Development Environmentâ) and pick a location of your choice. (No need to tick the checkbox âCreate Git repositoryâ as the ZAP projects you downloaded are already Git repositories.) Click on âCreateâ.

After creating the empty project, click the settings gear icon on the upper right and go to âProject Structureâ. On the next window that pops up, pick an installed SDK.


In the same window, select the âModulesâ tab under âProject Settingsâ, click on the â button, and select âImport Moduleâ.

Then, in the âSelect File or Directory to Importâ window, navigate to any one of the cloned ZAP repositories, select the âbuild.gradle.ktsâ file that is present in the root of its directory, and click on OK.

Repeat the last two steps until you have imported all of the ZAP repositories as modules. Then, click on OK in the âProject Structureâ window.
You should now be able to see all the imported repositories in the IntelliJ IDEA Project tab.
It is worth noting that some of the zap-extensions add-ons may fail to compile if you do not have the required environment for them. This is to be expected and is not a problem unless you want to work on those add-ons, in which case see their READMEs for more details.
In the IntelliJ Project tab navigate to:
Right click on ZAP and select âRun ZAP.main()â.

In case you are unable to see this option, go to âViewâ â âTool Windowsâ â âGradleâ. Then, in the Gradle tab, click on the âReload All Gradle Projectsâ button before trying this step again.
ZAP will now start but it is not set up quite right and may show warning dialogs, so close it and go back to IntelliJ.
Select the âRunâ â âEdit ConfigurationsâŚâ and then the ZAP configuration under âApplicationâ.
Change the âWorking directoryâ by browsing to: .../zaproxy/zap/src/main/dist/. Here, .../zaproxy should be replaced by the complete path to the cloned zaproxy repository on your system.

Click on Apply and try running ZAP again. ZAP should now start with all of the add-ons correctly configured.
You can run the ZAP Gradle tasks from the command line or from within IntelliJ IDEA - the end result will be the same.
IntelliJ has a âGradleâ tab that lists all of the tasks available to you ordered by project. You can view this tab by going to âViewâ â âTool Windowsâ â âGradleâ.
Note that the add-ons in zap-extensions all have their own set of tasks in addition to the top level ones.
The Database tab in IntelliJ IDEA can be used to inspect a session database. The following links may be used for reference:
Sometimes IntelliJ will unexpectedly fail to compile ZAP code. This can occur if you switch between git branches which have different dependencies.
If this happens to you then right click on the relevant project in the Gradle tab and select âReload Gradle Projectâ.
If that doesnât work either, try doing âFileâ â âInvalidate Caches / RestartâŚâ.
Do you have any other Tips and Tricks for working on ZAP using IntelliJ IDEA? If so then send a PR to update this page - you can use the âEdit on GitHubâ link in the footer.