For the complete documentation index, see llms.txt. This page is also available as Markdown.

Code Analyzer prerequisites

The PMD and CPD engines require a Java runtime and the Code Analyzer engine libraries. This page covers what to download and where to put it.

The pmd and cpd engines run on the JVM. The eslint engine does not and needs neither of these.

Requirement
Version

Java

11.0.0 or later, on PATH

Code Analyzer engine libraries

0.40.0 for sfp v51

To pin a specific JDK instead of the one on PATH, set java_command in the Code Analyzer configuration file:

# config/code-analyzer.yml
engines:
  pmd:
    java_command: /usr/lib/jvm/java-21-openjdk/bin/java

Step 1: Download the engine libraries

curl -sL https://registry.npmjs.org/@salesforce/code-analyzer-pmd-engine/-/code-analyzer-pmd-engine-0.40.0.tgz \
  | tar -xz -C /tmp

The tarball has SHA-1 3fba2fb397f31861691862fa8a692f99c145b684. Where npm is available, npm install @salesforce/code-analyzer-pmd-engine@0.40.0 fetches the same package into node_modules/@salesforce/code-analyzer-pmd-engine/.

Step 2: Copy them into place

Platform

Copy dist/java-lib to

Create package.json in

Linux

/opt/flxbl-io/dist/java-lib

/opt/flxbl-io/

macOS

/Applications/sfp-pro.app/Contents/dist/java-lib

/Applications/sfp-pro.app/Contents/

Windows

C:\Program Files\flxbl-io\dist\java-lib

C:\Program Files\flxbl-io\

The package.json holds {"name":"sfp","version":"0.0.0"}.

Linux

macOS

Adding files to a signed application bundle invalidates its code signature. If macOS then declines to launch the binary, reinstall the application and run sfp from a Node.js package tree instead.

Windows

Run in PowerShell as Administrator:

Step 3: Verify

The count varies with the project. Rules Checked in the results summary reports the same number, and is greater than zero.

If the libraries are missing

The command exits 0 in this state, including with --fail-on code-analyzer. Where the analyzer gates a pipeline, assert on Rules Checked rather than the exit status alone. ENOENT: no such file or directory, open '/opt/flxbl-io/package.json' means the JAR files are in place but the package.json from Step 2 is not.

Upgrading sfp

Upgrading sfp does not update these libraries. Repeat Step 1 and Step 2 when the required engine version changes.

Last updated

Was this helpful?