How do I update my server's Java version to 11+?

In the console when I start my server, it states that Paper in 1.17 will require Java 11+ and that I am using Java 8. The current command I use to start my server is “java -Xmx6G -Xms3G -jar 1.16.5-paper-468.jar” which I believe is using my JRE 8 from Oracle. I also have AdoptOpenJDK 8 and 14 on my PC and wanted to figure out how to change the Java version that the server starts with ahead of time to AdoptOpenJDK 14. How can I do this? I thought before that it was by default starting with JDK 14, but the server is being started from the batch file, so it probably wasn’t using JDK 14 even though I set that as my default jar opener.

You can replace the java with full path, i.e java -jar into “C:/Program Files/Java/jdk-15.0.2/bin/java.exe” -jar, or something like that.

Or you can just change your envrionment variables, i.e JAVA_HOME variable, or PATH variable to point java command into the Java 11/15 location.

If you don’t want to manually do this, download AdoptOpenJDK again from adoptopenjdk site, and then select all stuff with JAVA_HOME/PATH or J2SOFT Registry Keys, click on “Install entire feature”. It will set automatically your default Java version to the one you are installing.