> For the complete documentation index, see [llms.txt](https://docs.forestall.io/forestall/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.forestall.io/forestall/introduction/maintenance/openjdk.md).

# 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.

{% hint style="info" %}
`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.
{% endhint %}

## Download OpenJDK 11

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

[OpenJDK11U-jre\_x64\_windows\_hotspot\_11.0.24\_8.msi](https://fsprotect.s3.eu-central-1.amazonaws.com/share/OpenJDK11U-jre_x64_windows_hotspot_11.0.24_8.msi)

{% hint style="warning" %}
Both methods remove Java SE 15 **before** OpenJDK 11 is installed, so the two versions never run side by side. Plan a short maintenance window. If you can, try the switch on a non-production server first.
{% endhint %}

## Method 1: Run the upgrade script (recommended)

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

```powershell
.\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:

   ```
   dbms.jvm.additional=-XX:G1PeriodicGCInterval=5000
   ```
4. In an elevated PowerShell session, reinstall and start the Neo4j service, then restart IIS:

   ```powershell
   cd C:\Forestall\FSProtect\neo4j\neo4j-community-4.4.8\bin
   .\neo4j.bat uninstall-service
   .\neo4j.bat install-service
   .\neo4j.bat start
   iisreset.exe
   ```

## Verify

1. Confirm the `neo4j` service is **Running** (`Get-Service neo4j`).
2. Open the [Health Check](/forestall/health-check.md) 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.

{% hint style="info" %}
Contact Forestall support before rolling back a production server, especially if scans have already run successfully on OpenJDK 11.
{% endhint %}
