Java runtime discovery

scripts/java-runtime.ps1 locates a usable 64-bit Java 25+ executable.

Type: PowerShell helper
Scope: Discovery and validation
View source

Search order

SourceBehavior
Custom overrideUses java-home.txt or JAROCK_JAVA_HOME when provided.
Saved runtimeReuses the selected absolute executable from local server settings.
EnvironmentChecks JAVA_HOME and PATH candidates.
Windows locationsChecks common vendor folders and relevant registry entries.
ValidationRuns version, 64-bit, and minimum-version checks before selection.

When the check fails

The launcher lists candidates that could not be executed or inspected and provides a suggested Java 25 installation path. Java 8 and Java 21 may remain installed; they are rejected for Minecraft 26.2 rather than blindly selected.

If Java is installed in a custom directory, put the JDK folder or its bin\java.exe path in the root java-home.txt, then run start-server.bat again.

Environment automation

When enabled in the parameter manager, Jarock updates only the current user's JAVA_HOME and PATH ordering. It does not uninstall runtimes or modify machine-wide variables.