Install

To use eclipse-pmd, you need to run Eclipse with Java 21. You can still compile and analyze projects that use an older Java version. To set the JVM, you have to set the parameter -vm in your eclipse.ini accordingly. The Eclipse Wiki explains how to set up the JVM correctly.

Eclipse Marketplace

The recommended way to install the plugin on Eclipse 2023-12 (and later) is to drag and drop the following button into a running Eclipse workspace: Install eclipse-pmd

Update Site

An alternative way to install the plugin on Eclipse 2023-12 (and later) is via the plugin update site https://eclipse-pmd.acanda.ch/release/latest.

  1. In Eclipse go to Help > Install new software...
  2. Add a new installation site and use https://eclipse-pmd.acanda.ch/release/latest as the location.
  3. Select the plugin Eclipse PMD.
  4. Finish the installation by accepting the license and restarting Eclipse.

If you cannot use Java 21 or later for some reason, you can use an older version of eclipse-pmd. Those versions are not maintained anymore and you will not get the latest features if you use their update site.

Java Version eclipse-pmd Version Update Site Updates
Java 21 eclipse-pmd 4.x https://eclipse-pmd.acanda.ch/release/latest Yes
Java 17 eclipse-pmd 3.12 https://eclipse-pmd.acanda.ch/release/3.12 No
Java 11 eclipse-pmd 2.25 https://eclipse-pmd.acanda.ch/release/2.25 No
Java 7 eclipse-pmd 1.28 https://eclipse-pmd.acanda.ch/release/1.28 No

Offline Installation

If you do not have access to the internet you can download the plugin as a zip file and install it manually.

  1. Download the latest zip file from https://github.com/eclipse-pmd/eclipse-pmd/releases and copy it to your offline computer.
  2. In Eclipse go to Help > Install new software...
  3. Add a new installation site and click the button Archive... to select to zip file you downloaded.
  4. Select the plugin Eclipse PMD.
  5. Finish the installation by accepting the license and restarting Eclipse.

Activate

Use the property dialog of your project(s) to activate eclipse-pmd.

  1. If you don't already have a PMD rule set then create a new one.
  2. Open the property dialog of your project.
  3. Select the PMD property page.
  4. Check the Enable PMD for this project checkbox.
  5. Add one or more rule sets by clicking the Add... button.
  6. Close the property dialog. Your project will now be analysed by PMD.
  7. If you have another project where you want to activate eclipse-pmd, continue with step 2.