Question Specifying java version in a run.bat

iLilyth

New member
May 5, 2023
1
0
1
Hi! i have multiple JDK versions installed because i mod for 1.8.9, but i cant get my run.bat to recognize my jdk version 17. Does anyone know how to fix this?

1683317964246.png
 

Attachments

  • 1683317958879.png
    1683317958879.png
    22.9 KB · Views: 0

stefvanschie

Moderator
Staff member
Dec 17, 2021
106
5
17
18
If you're using the java command directly, it'll use the version set in your PATH environment variable (if you're using Windows). If that's pointing to an older version of Java, it'll try to use that one. When needing to manage multiple different versions, it's generally easier to specify the full path to the correct Java installation to use. so instead of using something like java -jar paper.jar, you'd use \path\to\correct\java\installation\java.exe -jar paper.jar. This will ensure it uses the java in that directory, rather than whichever one java is pointing to.