Setup

To get started with Salesforce Code Analyzer, complete the prerequisites and follow the installation instructions. You can install version 3.x (generally available) or version 4.x (beta).

To use the most up-to-date Code Analyzer features including PMD 7.x, upgrade your installation to v4.x (beta).

To set up Salesforce Code Analyzer, complete these prerequisites.

Some Code Analyzer features depend on the Java Platform, Standard Edition Java Development Kit (JDK). Install JDK version 11 or later.

Code Analyzer is a Salesforce CLI plugin, so you must install Salesforce CLI on your machine. Then use Salesforce CLI to execute commands against Salesforce orgs and work with source files on your local computer.

For information about installing Salesforce CLI, read Install Salesforce CLI.

Complete the prerequisites before you install Salesforce Code Analyzer.

To install Salesforce Code Analyzer v3.x, run this command.

By default, latest tag is applied, which corresponds to v3.x.

You can also specifically install the latest GA version of Code Analyzer with this command.

To install Code Analyzer v4.x (beta), run this command.

To check that Code Analyzer is installed, run this command.

To install a specific Code Analyzer version, run this command.

To display Code Analyzer usage and Help, run this command.

To update Code Analyzer v4.x (beta), rerun the installation command.

To update Code Analyzer v3.x, run this command.

To uninstall Code Analyzer, run this command.