Hello folks!
I was able to make modifications to the JavaBuild.java and run the JavaFX sketches in this topic with the JavaFX library as is:
-
without any modifications to the JavaFX library
-
without adding any JavaFX jars to the sketch
This is where I modified:
processing4/java/src/processing/mode/java/JavaBuild.java at main · processing/processing4 · GitHub
The modified Processing PDE ran the code successfully but the editor gave false flags (underlined in red) about the classes not existing and I was able to make modifications to these files to address this:
I also inserted print statements in that file to provide debug information:
Debug output of modified Processing
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.base.jar
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.controls.jar
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.fxml.jar
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.graphics.jar
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.media.jar
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.swing.jar
classpath_0: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.web.jar
DEBUG: Successfully added 7 JavaFX module paths.
classpath_1: ;D:\Users\GLV\Documents\Processing\libraries\javafx\library\javafx.jar
javaLibraryPath: ;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64
classPath: D:\temp\processing\JavaFX_Controls_Preview_New7169551845653962132temp;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\annotations-13.0.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\antlr-2.7.7.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\core-sources.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\core.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-android-aarch64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-linux-aarch64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-linux-amd64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-linux-armv6hf.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-macosx-universal.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-windows-amd64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-2.5.0.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\gluegen-rt-main-2.5.0.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0-natives-android-aarch64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0-natives-linux-aarch64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0-natives-linux-amd64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0-natives-linux-armv6hf.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0-natives-macosx-universal.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0-natives-windows-amd64.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-2.5.0.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\jogl-all-main-2.5.0.jar;F:\test2\processing4\app\build\compose\binaries\main\app\Processing\app\resources\core\library\kotlin-stdlib-2.0.20.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.base.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.controls.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.fxml.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.graphics.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.media.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.swing.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\windows-amd64\modules\javafx.web.jar;D:\Users\GLV\Documents\Processing\libraries\javafx\library\javafx.jar
WARNING: Custom port 0 is invalid. Falling back to random selection.
Debug Port Selected: 8257
Google Gemini was my collaborative assistant in the process.
I will not be sharing the code generated for this.
Conclusions (Goggle Gemini assisted) from examining the Class Paths from original and modified Processing:
Processing 4.4.10 is not adding the JavaFX modules to the class path.
This can be examined with these in a sketch:
println(System.getProperty("java.class.path"));
println(System.getProperty("java.library.path"));
Output (with modified code to format):
Class Paths and Library Paths
[java.class.path](path.separator: ";"):
- D:\temp\processing\Print_System_Data_1_0_212922241895653343933temp
-
- E:\Processing\app\resources\core\library\annotations-13.0.jar
- E:\Processing\app\resources\core\library\antlr-2.7.7.jar
- E:\Processing\app\resources\core\library\core-4.4.10.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-android-aarch64.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-linux-aarch64.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-linux-amd64.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-linux-armv6hf.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-macosx-universal.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0-natives-windows-amd64.jar
- E:\Processing\app\resources\core\library\gluegen-rt-2.5.0.jar
- E:\Processing\app\resources\core\library\gluegen-rt-main-2.5.0.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0-natives-android-aarch64.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0-natives-linux-aarch64.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0-natives-linux-amd64.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0-natives-linux-armv6hf.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0-natives-macosx-universal.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0-natives-windows-amd64.jar
- E:\Processing\app\resources\core\library\jogl-all-2.5.0.jar
- E:\Processing\app\resources\core\library\jogl-all-main-2.5.0.jar
- E:\Processing\app\resources\core\library\kotlin-stdlib-2.0.20.jar
- E:\SketchbookFolder\libraries\video\library\gst1-java-core-1.4.0.jar
- E:\SketchbookFolder\libraries\video\library\jna.jar
- E:\SketchbookFolder\libraries\video\library\video.jar
- E:\Processing\app\resources\modes\java\libraries\serial\library\jssc.jar
- E:\Processing\app\resources\modes\java\libraries\serial\library\serial.jar
- E:\SketchbookFolder\libraries\javafx\library\javafx.jar
[java.library.path](path.separator: ";"):
- E:\SketchbookFolder\Print_System_Data_1_0_2\code
- E:\Processing\app\resources\core\library
- E:\SketchbookFolder\libraries\video\library\windows-amd64
- E:\Processing\app\resources\modes\java\libraries\serial\library
- E:\SketchbookFolder\libraries\javafx\library\windows-amd64
- E:\Processing
- C:\WINDOWS\system32
- C:\WINDOWS
- E:\Processing\app
- .
My exploration in this post is focused only on the root cause of why JavaFX is not working as expected and experimenting with the code for personal development.
There are already some issues related to this on GitHub and a search for JavaFX will find these.
In the meant time…
Several workarounds have been presented in this topic for those interested in exploring JavaFX.
I had fun exploring this and encourage others to do the same!
Have fun!
:)

