Skip to content

Commit

Permalink
Fix: On windows, try to pull java exe from JAVA_HOME for autoupdating
Browse files Browse the repository at this point in the history
  • Loading branch information
zxtej committed Oct 26, 2024
1 parent 9680522 commit e71495b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/mindustry/Vars.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ public static void init(){
bases = new BaseRegistry();
logicVars = new GlobalVars();
javaPath =
new Fi(OS.prop("java.home")).child("bin/java").exists() ? new Fi(OS.prop("java.home")).child("bin/java").absolutePath() :
new Fi(OS.prop("java.home")).child("bin/java").exists() ? new Fi(OS.prop("java.home")).child("bin/java").absolutePath() : // Unix
new Fi(OS.prop("java.home")).child("bin/java.exe").exists() ? new Fi(OS.prop("java.home")).child("bin/java.exe").absolutePath() : // Windows
Core.files.local("jre/bin/java").exists() ? Core.files.local("jre/bin/java").absolutePath() : // Unix
Core.files.local("jre/bin/java.exe").exists() ? Core.files.local("jre/bin/java.exe").absolutePath() : // Windows
"java"; // Fallback
Expand Down

0 comments on commit e71495b

Please sign in to comment.