diff --git a/java/src/processing/mode/java/pdex/PreprocessingService.java b/java/src/processing/mode/java/pdex/PreprocessingService.java index 5e9d3f0bf..31e8d27f3 100644 --- a/java/src/processing/mode/java/pdex/PreprocessingService.java +++ b/java/src/processing/mode/java/pdex/PreprocessingService.java @@ -596,16 +596,31 @@ public class PreprocessingService { static private List 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); + } } }