Problem using "Zulu" JDK 11-bundled OpenJFX with SWT [message #1816371] |
Mon, 28 October 2019 13:52  |
Mark Thurman Messages: 3 Registered: October 2019 |
Junior Member |
|
|
We want to use both SWT and JavaFX in an Eclipse plugin within our RCP application. Unfortunately, we're experiencing problems integrating SWT with JavaFX under Java 11. The build environment uses e(fx)clipse 3.5. We're developing against the Community edition of Azul Systems' "Zulu" JDK 11, bundled with Azul's version of OpenJFX.
Formerly, we developed under Java 8. At that point, our build used a compile-time class path referring to jfxswt.jar, which lived in the "jre/lib" directory of the JDK. We didn't use any special class path settings at run-time.
We are now trying to move to Java 11. There, this JAR has become javafx-swt.jar and lives in the "lib" directory of the JDK. It no longer seems to be enough to set the class path to refer to this JAR at compile time: it seems to be necessary to do so at run time too. If we don't do this, we get an error ("java.lang.NoClassDefFoundError: javafx/embed/swt/FXCanvas").
As a test, we experimentally embedded javafx-swt.jar within the JAR implementing our Eclipse plugin. We then referred to it in that plugin's .classpath file, and the code worked as expected. Unfortunately, we can't embed the JAR this way for legal and other reasons.
A note on Java modules: javafx.swt does not show up in the output when we issue the "--list-module" command. We tried running the application using parameters "-p {JDK/lib/javafx-swt.jar} --add-modules javafx.swt", but this doesn't seem to solve the problem.
My question: Is there a way to set up the class or module path to allow our Eclipse plugin to find this library in the JRE? Any solution would have to work with whatever JRE the code happens to be run against (I think it is all right to assume lib/javafx-swt.jar will live in that JRE).
Would it help to use a separately-downloaded version of OpenJFX rather than the copy of OpenJFX in our JDK?
I notice that a similar problem was mentioned in this thread: https://www.eclipse.org/forums/index.php/t/1095065/ (except that the questioner was interested in Java 10). I am afraid that I don't quite understand how to implement the solution given there, or whether it is relevant to this JDK which is bundled with OpenJFX. I have opened a new thread since the old one was from a year ago.
Very many thanks ☺
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03404 seconds