add javaPath variable (#6126)
This commit is contained in:
@@ -199,6 +199,8 @@ public class Vars implements Loadable{
|
|||||||
public static final String saveExtension = "msav";
|
public static final String saveExtension = "msav";
|
||||||
/** schematic file extension */
|
/** schematic file extension */
|
||||||
public static final String schematicExtension = "msch";
|
public static final String schematicExtension = "msch";
|
||||||
|
/** path to the java executable */
|
||||||
|
public static String javaPath;
|
||||||
|
|
||||||
/** list of all locales that can be switched to */
|
/** list of all locales that can be switched to */
|
||||||
public static Locale[] locales;
|
public static Locale[] locales;
|
||||||
@@ -293,6 +295,10 @@ public class Vars implements Loadable{
|
|||||||
pathfinder = new Pathfinder();
|
pathfinder = new Pathfinder();
|
||||||
bases = new BaseRegistry();
|
bases = new BaseRegistry();
|
||||||
constants = new GlobalConstants();
|
constants = new GlobalConstants();
|
||||||
|
javaPath =
|
||||||
|
new Fi(OS.prop("java.home")).child("bin/java").exists() ? new Fi(OS.prop("java.home")).child("bin/java").absolutePath() :
|
||||||
|
Core.files.local("jre/bin/java").exists() ? Core.files.local("jre/bin/java").absolutePath() :
|
||||||
|
"java";
|
||||||
|
|
||||||
state = new GameState();
|
state = new GameState();
|
||||||
|
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ public class BeControl{
|
|||||||
download(updateUrl, file, i -> length[0] = i, v -> progress[0] = v, () -> cancel[0], () -> {
|
download(updateUrl, file, i -> length[0] = i, v -> progress[0] = v, () -> cancel[0], () -> {
|
||||||
try{
|
try{
|
||||||
Runtime.getRuntime().exec(OS.isMac ?
|
Runtime.getRuntime().exec(OS.isMac ?
|
||||||
new String[]{"java", "-XstartOnFirstThread", "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()} :
|
new String[]{javaPath, "-XstartOnFirstThread", "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()} :
|
||||||
new String[]{"java", "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()}
|
new String[]{javaPath, "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()}
|
||||||
);
|
);
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
|
|||||||
Reference in New Issue
Block a user