Add JavaFX runtime to error checker class path

In case somebody needs to work with native FX windows or events, here
they are, ready to be imported (like AWT stuff).
This commit is contained in:
Jakub Valtar
2017-07-20 19:26:15 +02:00
parent e85f10f65b
commit 7dc3062db1

View File

@@ -596,16 +596,31 @@ public class PreprocessingService {
static private List<String> buildJavaRuntimeClassPath() {
StringBuilder classPath = new StringBuilder();
// Java runtime
String rtPath = System.getProperty("java.home") +
File.separator + "lib" + File.separator + "rt.jar";
if (new File(rtPath).exists()) {
classPath.append(File.pathSeparator).append(rtPath);
} else {
rtPath = System.getProperty("java.home") + File.separator + "jre" +
{ // Java runtime
String rtPath = System.getProperty("java.home") +
File.separator + "lib" + File.separator + "rt.jar";
if (new File(rtPath).exists()) {
classPath.append(File.pathSeparator).append(rtPath);
} else {
rtPath = System.getProperty("java.home") + File.separator + "jre" +
File.separator + "lib" + File.separator + "rt.jar";
if (new File(rtPath).exists()) {
classPath.append(File.pathSeparator).append(rtPath);
}
}
}
{ // JavaFX runtime
String jfxrtPath = System.getProperty("java.home") +
File.separator + "lib" + File.separator + "ext" + File.separator + "jfxrt.jar";
if (new File(jfxrtPath).exists()) {
classPath.append(File.pathSeparator).append(jfxrtPath);
} else {
jfxrtPath = System.getProperty("java.home") + File.separator + "jre" +
File.separator + "lib" + File.separator + "ext" + File.separator + "jfxrt.jar";
if (new File(jfxrtPath).exists()) {
classPath.append(File.pathSeparator).append(jfxrtPath);
}
}
}