Skip to content

Commit cdf88e6

Browse files
committed
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).
1 parent fa2d64a commit cdf88e6

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

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)