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

Using OpenJDK 11 instead of Java SE 15

The bundled Neo4j 4.4 graph database runs on Java 11, but the Forestall installer ships Java(TM) Platform SE 15 as its prerequisite. If you need an OpenJDK LTS release, you can replace Java SE 15 with OpenJDK 11. OpenJDK 11 is supported.

The Neo4j service is registered against the java.exe found when neo4j.bat install-service runs, so the service has to be reinstalled after Java is replaced.

neo4j.conf contains a Java 15-specific JVM option, dbms.jvm.additional=-XX:G1PeriodicGCInterval=5000. OpenJDK 11 doesn't support this option, and Neo4j won't start while it is present. Both methods below remove it.

Download OpenJDK 11

Download the OpenJDK 11 JRE that has been tested with Forestall:

OpenJDK11U-jre_x64_windows_hotspot_11.0.24_8.msi

Run Upgrade-Java-To-OpenJDK11.ps1 from C:\Forestall\FSProtect\setup-files\scripts\utils\ in an elevated PowerShell session:

.\Upgrade-Java-To-OpenJDK11.ps1 -MsiPath "C:\path\to\OpenJDK11U-jre_x64_windows_hotspot_11.0.24_8.msi"

The script:

  1. Finds and silently uninstalls Java SE 15.

  2. Installs the OpenJDK 11 MSI silently, with the options that set JAVA_HOME and PATH.

  3. Fails with an error if JAVA_HOME is still not set afterwards.

  4. Removes the dbms.jvm.additional=-XX:G1PeriodicGCInterval line from neo4j.conf.

  5. Reinstalls and starts the Neo4j Windows service against the new java.exe.

  6. Runs iisreset.exe.

If it exits with an MSI error, check the log it prints (%TEMP%\OpenJDK11-install.log) before retrying.

Method 2: Manual steps

  1. On the Forestall server, open Settings > Apps > Installed apps (or Add or remove programs) and uninstall Java SE Development Kit 15.

  2. Run the OpenJDK 11 MSI you downloaded as Administrator and complete the wizard with the default options.

  3. Open C:\Forestall\FSProtect\neo4j\neo4j-community-4.4.8\conf\neo4j.conf and delete the last line:

  4. In an elevated PowerShell session, reinstall and start the Neo4j service, then restart IIS:

Verify

  1. Confirm the neo4j service is Running (Get-Service neo4j).

  2. Open the Health Check page and confirm the Neo4j Graph Database checks for API and Core show Running.

Rollback

To go back to Java SE 15:

  1. Uninstall OpenJDK 11 and reinstall Java SE 15. The installer is part of the Forestall installation package. Contact Forestall support if you no longer have it.

  2. Add dbms.jvm.additional=-XX:G1PeriodicGCInterval=5000 back to the end of neo4j.conf.

  3. Reinstall the Neo4j service and restart IIS with the same commands as in Method 2, step 4.

Contact Forestall support before rolling back a production server, especially if scans have already run successfully on OpenJDK 11.

Last updated

Was this helpful?