Direct answer
On Linux, the Java executable used by your launch script or systemd unit matters more than the default selected in an interactive shell.
Recommended procedure
- Check the shell default with
command -v java,readlink -f "$(command -v java)"andjava -version. - Inspect the Minecraft startup command or
systemctl cat minecraft.service(replace the service name with your own). A unit may call a fixed Java path. - Check the required runtime for your exact Minecraft build. Paper’s current Java installation guide covers modern Paper builds; older releases may require another runtime.
- If multiple JDKs are installed, use a full executable path in the launch script or service instead of changing the system-wide default unexpectedly.
command -v java
readlink -f "$(command -v java)"
java -version
systemctl cat minecraft.service
Why this matters
Changing the shell’s PATH or Linux alternatives selection does not automatically change an existing systemd ExecStart. Back up the service file and use systemctl daemon-reload only if you deliberately edit the unit.
How to verify the result
Restart in a maintenance window, confirm the Java version printed by the server startup log, and check plugin compatibility and world loading before allowing players back.
Version and compatibility notes
Exact Java paths and package names vary by Linux distribution. Do not force a Java 25 runtime on an older unsupported Minecraft build without checking its requirements.
Official references
Related guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.