From 7dc3062db116bbbd0374946eacfeb0918428c886 Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Thu, 20 Jul 2017 19:26:15 +0200 Subject: [PATCH 1/2] 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). --- .../mode/java/pdex/PreprocessingService.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) 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); + } } } From ab8daaed293bf68ea51fa3934ef7b2db97c124eb Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Thu, 20 Jul 2017 19:34:10 +0200 Subject: [PATCH 2/2] Add FX to ignorable imports To get rid of missing library messages --- java/src/processing/mode/java/JavaBuild.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index 88f6fc3be..5d1e32953 100644 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -520,6 +520,7 @@ public class JavaBuild { protected boolean ignorableImport(String pkg) { if (pkg.startsWith("java.")) return true; if (pkg.startsWith("javax.")) return true; + if (pkg.startsWith("javafx.")) return true; if (pkg.startsWith("processing.core.")) return true; if (pkg.startsWith("processing.data.")) return true;