Skip to content

Commit ef2933d

Browse files
authored
Merge pull request #5186 from JakubValtar/fx-runtime
Add JavaFX runtime to error checker class path
2 parents ad28f18 + 98b8ab9 commit ef2933d

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

java/src/processing/mode/java/JavaBuild.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ public String preprocess(File srcFolder,
524524
protected boolean ignorableImport(String pkg) {
525525
if (pkg.startsWith("java.")) return true;
526526
if (pkg.startsWith("javax.")) return true;
527+
if (pkg.startsWith("javafx.")) return true;
527528

528529
if (pkg.startsWith("processing.core.")) return true;
529530
if (pkg.startsWith("processing.data.")) return true;

java/src/processing/mode/java/pdex/PreprocessingService.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -596,16 +596,31 @@ static private List<String> buildSketchLibraryClassPath(JavaMode mode,
596596
static private List<String> buildJavaRuntimeClassPath() {
597597
StringBuilder classPath = new StringBuilder();
598598

599-
// Java runtime
600-
String rtPath = System.getProperty("java.home") +
601-
File.separator + "lib" + File.separator + "rt.jar";
602-
if (new File(rtPath).exists()) {
603-
classPath.append(File.pathSeparator).append(rtPath);
604-
} else {
605-
rtPath = System.getProperty("java.home") + File.separator + "jre" +
599+
{ // Java runtime
600+
String rtPath = System.getProperty("java.home") +
606601
File.separator + "lib" + File.separator + "rt.jar";
607602
if (new File(rtPath).exists()) {
608603
classPath.append(File.pathSeparator).append(rtPath);
604+
} else {
605+
rtPath = System.getProperty("java.home") + File.separator + "jre" +
606+
File.separator + "lib" + File.separator + "rt.jar";
607+
if (new File(rtPath).exists()) {
608+
classPath.append(File.pathSeparator).append(rtPath);
609+
}
610+
}
611+
}
612+
613+
{ // JavaFX runtime
614+
String jfxrtPath = System.getProperty("java.home") +
615+
File.separator + "lib" + File.separator + "ext" + File.separator + "jfxrt.jar";
616+
if (new File(jfxrtPath).exists()) {
617+
classPath.append(File.pathSeparator).append(jfxrtPath);
618+
} else {
619+
jfxrtPath = System.getProperty("java.home") + File.separator + "jre" +
620+
File.separator + "lib" + File.separator + "ext" + File.separator + "jfxrt.jar";
621+
if (new File(jfxrtPath).exists()) {
622+
classPath.append(File.pathSeparator).append(jfxrtPath);
623+
}
609624
}
610625
}
611626

0 commit comments

Comments
 (0)