Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Problem using "Zulu" JDK 11-bundled OpenJFX with SWT(Problem using "Zulu" JDK 11-bundled OpenJFX with SWT)
Problem using "Zulu" JDK 11-bundled OpenJFX with SWT [message #1816371] Mon, 28 October 2019 13:52 Go to next message
Mark Thurman is currently offline Mark ThurmanFriend
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 ☺
Re: Problem using "Zulu" JDK 11-bundled OpenJFX with SWT [message #1816540 is a reply to message #1816371] Wed, 30 October 2019 20:01 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Well you can never put javafx-swt.jar on the module-path because then you'd have to have swt itself there as well. I have to confess that I never looked into zulu but wouldn't it be possible to use the zulu version who does not bundle javafx and deliver fx as part of your application ?
Re: Problem using "Zulu" JDK 11-bundled OpenJFX with SWT [message #1816580 is a reply to message #1816540] Thu, 31 October 2019 18:02 Go to previous messageGo to next message
Mark Thurman is currently offline Mark ThurmanFriend
Messages: 3
Registered: October 2019
Junior Member
Thanks for this help - it's really appreciated. Yes, using a separate JavaFX was something we were considering, and we'll try this. I was just hoping to leverage the OpenJFX (and javafx-swt.jar) which is bundled with the Azul JDK.

Just wondering - do you have any other general advice concerning this kind of migration (unrelated to the Azul JDK in particular)? Do you have any pointers as to how in general you would suggest someone used JavaFX and SWT together with Java 11 in an Eclipse RCP application?

Thanks again
Re: Problem using "Zulu" JDK 11-bundled OpenJFX with SWT [message #1816583 is a reply to message #1816580] Thu, 31 October 2019 19:59 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Can you file an issue at github - I think the adapter hook could solve your problem / directly support zulu-fx
Re: Problem using "Zulu" JDK 11-bundled OpenJFX with SWT [message #1816616 is a reply to message #1816540] Fri, 01 November 2019 14:43 Go to previous message
Mark Thurman is currently offline Mark ThurmanFriend
Messages: 3
Registered: October 2019
Junior Member
Thanks very much. I have created a bug report at https://github.com/eclipse-efx/efxclipse-rt/issues/381. In the short term, we will just try using a separately installed version of OpenJFX.

Kind regards
Previous Topic:Using tool control in ef(x) based application
Next Topic:Upgrading to Eclipse 2019-06 and it cannot find the FXCanvas class
Goto Forum:
  


Current Time: Fri Nov 15 15:19:34 GMT 2019

Powered by FUDForum. Page generated in 0.02739 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top