diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index 4451174c9..762d4648e 100644 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -440,6 +440,13 @@ public class JavaBuild { } + /** Returns the dummy "module" path so that JavaFX doesn't complain. */ + public String getModulePath() { + // Just set this to the main core/library directory to pick up JavaFX + return mode.getCoreLibrary().getLibraryPath(); + } + + /** Return the java.library.path for this sketch (for all the native DLLs etc). */ public String getJavaLibraryPath() { return javaLibraryPath; diff --git a/java/src/processing/mode/java/runner/Runner.java b/java/src/processing/mode/java/runner/Runner.java index df53a3fa0..da8cbacf9 100644 --- a/java/src/processing/mode/java/runner/Runner.java +++ b/java/src/processing/mode/java/runner/Runner.java @@ -373,6 +373,20 @@ public class Runner implements MessageConsumer { params.append(javaLibraryPathParam); + // TODO this should only happen with sketches using the JavaFX library + // https://github.com/processing/processing4/issues/209 + params.append("--module-path"); + params.append(build.getModulePath()); + params.append("--add-modules"); + //params.append("javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web"); + params.append("javafx.base,javafx.graphics,javafx.swing"); + // TODO Presumably, we need to move away from com.sun.* classes? + // https://github.com/processing/processing4/issues/208 + params.append("--add-exports"); + params.append("javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED"); + params.append("--add-exports"); + params.append("javafx.graphics/com.sun.glass.ui=ALL-UNNAMED"); + params.append("-cp"); params.append(build.getClassPath()); diff --git a/todo.txt b/todo.txt index 1e2ae992e..f99ead1f0 100755 --- a/todo.txt +++ b/todo.txt @@ -24,6 +24,7 @@ X https://developer.apple.com/documentation/bundleresources/entitlements/com_a X https://github.com/processing/processing4/commit/7b75acf2799f61c9c22233f38ee73c07635cea14 X update to launch4j 3.14, fixing Export to Application on Windows X change defaults to get away from JFileChooser; it's awful +X working on JavaFX on Windows, more runtime problems, needing exports for next release @@ -32,6 +33,7 @@ _ https://github.com/processing/processing4/issues/177 _ confirmed not working from Sam's repo either _ make sure we're not embedding webkit with all JFX apps _ maybe just remove it from the main download as well +_ remove javafx-swt.jar and javafx.web.jar / also their .so files _ check FX2D (and application export) on Windows and Linux