Skip to content

Commit 8e590b6

Browse files
committed
working on JavaFX on Windows, more runtime problems, needing exports
1 parent 687291a commit 8e590b6

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,13 @@ public String getClassPath() {
440440
}
441441

442442

443+
/** Returns the dummy "module" path so that JavaFX doesn't complain. */
444+
public String getModulePath() {
445+
// Just set this to the main core/library directory to pick up JavaFX
446+
return mode.getCoreLibrary().getLibraryPath();
447+
}
448+
449+
443450
/** Return the java.library.path for this sketch (for all the native DLLs etc). */
444451
public String getJavaLibraryPath() {
445452
return javaLibraryPath;

java/src/processing/mode/java/runner/Runner.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,20 @@ protected StringList getMachineParams() {
373373

374374
params.append(javaLibraryPathParam);
375375

376+
// TODO this should only happen with sketches using the JavaFX library
377+
// https://github.com/processing/processing4/issues/209
378+
params.append("--module-path");
379+
params.append(build.getModulePath());
380+
params.append("--add-modules");
381+
//params.append("javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web");
382+
params.append("javafx.base,javafx.graphics,javafx.swing");
383+
// TODO Presumably, we need to move away from com.sun.* classes?
384+
// https://github.com/processing/processing4/issues/208
385+
params.append("--add-exports");
386+
params.append("javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED");
387+
params.append("--add-exports");
388+
params.append("javafx.graphics/com.sun.glass.ui=ALL-UNNAMED");
389+
376390
params.append("-cp");
377391
params.append(build.getClassPath());
378392

todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ X https://developer.apple.com/documentation/bundleresources/entitlements/com_a
2424
X https://github.com/processing/processing4/commit/7b75acf2799f61c9c22233f38ee73c07635cea14
2525
X update to launch4j 3.14, fixing Export to Application on Windows
2626
X change defaults to get away from JFileChooser; it's awful
27+
X working on JavaFX on Windows, more runtime problems, needing exports
2728

2829

2930
for next release
@@ -32,6 +33,7 @@ _ https://github.com/processing/processing4/issues/177
3233
_ confirmed not working from Sam's repo either
3334
_ make sure we're not embedding webkit with all JFX apps
3435
_ maybe just remove it from the main download as well
36+
_ remove javafx-swt.jar and javafx.web.jar / also their .so files
3537
_ check FX2D (and application export) on Windows and Linux
3638

3739

0 commit comments

Comments
 (0)