Guess Java Binary Path

This commit is contained in:
Konloch 2021-07-19 12:23:25 -07:00
parent efd9f84729
commit 7467571c6f
2 changed files with 4 additions and 1 deletions

View file

@ -20,8 +20,9 @@ public class Configuration
public static boolean python3Extra = false; public static boolean python3Extra = false;
public static String rt = ""; public static String rt = "";
public static String library = ""; public static String library = "";
public static String java = Constants.JAVA_BINARY.exists() ? Constants.JAVA_BINARY.getAbsolutePath() :
Constants.JAVA_BINARY_NIX.exists() ? Constants.JAVA_BINARY_NIX.getAbsolutePath() : "";
public static String javac = ""; public static String javac = "";
public static String java = "";
public static String javaTools = ""; public static String javaTools = "";
public static File krakatauTempDir; public static File krakatauTempDir;
public static File krakatauTempJar; public static File krakatauTempJar;

View file

@ -30,6 +30,8 @@ public class Constants
//TODO check if $HOME/.local/share exists, if so reference from there instead - #250 //TODO check if $HOME/.local/share exists, if so reference from there instead - #250
public static final File BCVDir = new File(System.getProperty("user.home") + fs + ".Bytecode-Viewer"); public static final File BCVDir = new File(System.getProperty("user.home") + fs + ".Bytecode-Viewer");
public static final File RT_JAR = new File(System.getProperty("java.home") + fs + "lib" + fs + "rt.jar"); public static final File RT_JAR = new File(System.getProperty("java.home") + fs + "lib" + fs + "rt.jar");
public static final File JAVA_BINARY = new File(System.getProperty("java.home") + fs + "bin" + fs + "java.exe");
public static final File JAVA_BINARY_NIX = new File(System.getProperty("java.home") + fs + "bin" + fs + "java");
public static final File RT_JAR_DUMPED = new File(getBCVDirectory() + fs + "rt.jar"); public static final File RT_JAR_DUMPED = new File(getBCVDirectory() + fs + "rt.jar");
public static final String filesName = getBCVDirectory() + fs + "recentfiles.json"; public static final String filesName = getBCVDirectory() + fs + "recentfiles.json";
public static final String pluginsName = getBCVDirectory() + fs + "recentplugins.json"; public static final String pluginsName = getBCVDirectory() + fs + "recentplugins.json";