Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to - set up eclipse development with open JFX Java > 8(How to set up Eclipse tool development with OpenJDK, GEF, and OpenJFX for newer Java versions)
How to - set up eclipse development with open JFX Java > 8 [message #1822581] Tue, 10 March 2020 09:11 Go to next message
Svenja Wendler is currently offline Svenja WendlerFriend
Messages: 2
Registered: March 2020
Junior Member

Was it helpfull to you?[ 1 vote ]
1.yes 1 / 100%
2.no 0 / 0%

JavaFX is no longer a JRE component from Java 11
The first hurdle is already apparent when switching to Java 11, because JavaFX is no longer part of the JDK, either at Oracle or in the open source distribution OpenJDK. There are several solutions to this problem. One would be to use a JDK distribution that delivers Java 11 with JavaFX, such as Bellsoft's Liberica JDK. However, this article focuses on using e(fx)clipse and the OpenJFX SDK.
We use JavaFX in our YAKINDU products and have successfully and successfully converted the development of the GEF framework to the following configuration:




In the following we on the one hand convert our development environment to OpenJDK 11 with OpenJFX and e(fx)clipse, and then turn to the transition for our development, including compiler and launch configurations.
Transforming the development Environment

  • We download and install a new Eclipse IDE, ideally for Eclipse committers.
  • We upload OpenJDK 11 to any directory.
  • We download OpenJFX SDK and store it in a directory.
  • We install e(fx)clipse at least in version 3.6.0 in our Eclipse environment (Update-Site: https://download.eclipse.org/efxclipse/updates-nightly/site/).
  • We finish Eclipse and insert the following lines below the "-vmargs" line into the eclipse.ini file ("---add-modules=ALL-SYSTEM" does not need to be re-inserted if already available):
    -Dosgi.framework.extensions=org.eclipse.fx.osgi
    -Defxclipse.java-modules.dir=C:\Program Files\Java\javafx-sdk-11.0.2\lib
    --add-modules=ALL-SYSTEM

Note: We adjust the path to the OpenJFX libraries according to the operating system and the location in the file system. We don't use quotation marks, even if the path contains spaces. Otherwise, the setting would be tacitly ignored. Furthermore, the path must not be terminated with a slash or backslash. The changes to the eclipse.ini must be made after the installation of e(fx)clipse, otherwise Eclipse will not start again.

If OpenJDK 11 is the only JDK installed, nothing else needs to be changed. If OpenJDK 11 is not installed, but is only unpacked or other Java versions are installed on the computer, then the following lines should also be inserted in the eclipse.ini directly above the "-vmargs" line:
-vm
/path/to/jdk-11.0.5+10/Contents/Home/bin (adapt to your directory)
Now let's start Eclipse again. We then install the end-user tools of GEF DOT via the eclipse release update site (for example, http://download.eclipse.org/releases/2019-06). These use JavaFX (and SWT integration) so we can check if our installation worked.

Possible source of error here are the settings in the eclipse.ini, which we should look again step by step.

If the IDE finally runs successfully with OpenJDK 11, OpenJFX 11 and e(fx)clipse, we now take care of the workspace and the runtime.

In order to change the trend, the following must be done:


  • Set OpenJDK as JRE to use
  • Ensure that this JRE is used as an execution environment
  • Set the openjfx-libs folder in the e(fx)clipse preferences


These changes should compile the workspace. The following section describes these steps in more detail.
We set OpenJDK as a runtime environment in the Eclipse preferences. To do this, we select „Window → Preferences → Java → Installed JREs → Add ... and the path to the bin directory of the JDK.

We make sure that this JDK is applied to the execution environment we set. If necessary, we may remove all other JDKs to ensure that the OpenJDK is actually used.

We set the OpenJFX SDK in the preferences for e(fx)clipse. Above, we saved the OpenJFX SDK to a directory. Its lib directory must be in the Eclipse Preferences (Window → Preferences → JavaFX) JavaFX 11 + SDK. This should be the same path as before in the eclipse.ini. This setting makes your Eclipse aware of the JavaFX libraries for development.

Now everything is done to compile the workspace. If we want to start the application in the runtime, there is still a small thing to do.
We'll add the following VM arguments in the launch configuration; they are the same ones that we have previously entered in the eclipse.ini:
-Dosgi.framework.extensions=org.eclipse.fx.osgi
-Defxclipse.java-modules.dir=C:\Program Files\Java\javafx-sdk-11.0.2\lib

The procedure above should be used to switch existing Eclipse applications to OpenJDK 11 and OpenJFX 11 with e(fx)clipse.

Are there any comments or questions about this approach? We welcome any kind of feedback.

Re: How to - set up eclipse development with open JFX Java > 8 [message #1830959 is a reply to message #1822581] Fri, 07 August 2020 11:09 Go to previous messageGo to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
I tried to follow your recommendations on https://github.com/eclipse/gef setting up a new environment and it works fine until I try to look at the examples where it then obviously doesn't find the javafx classes, e.g.

Caused by: java.lang.ClassNotFoundException: javafx.embed.swt.FXCanvas cannot be found by org.eclipse.gef.mvc.fx.ui_5.1.1.202006020202

OR

Caused by: java.lang.ClassNotFoundException: javafx.scene.paint.Color cannot be found by org.eclipse.gef.mvc.examples.logo_5.2.1.202006020202

My execution environment seems to be correctly set to JavaSE-1.8 (openjdk11) and the VM arguments are:
-Dosgi.framework.extensions=org.eclipse.fx.osgi
-Defxclipse.java-modules.dir=/Users/guenther/Downloads/javafx-sdk-11.0.2/lib


Re: How to - set up eclipse development with open JFX Java > 8 [message #1831826 is a reply to message #1830959] Mon, 31 August 2020 10:08 Go to previous messageGo to next message
Svenja Wendler is currently offline Svenja WendlerFriend
Messages: 2
Registered: March 2020
Junior Member
Hi, does your problem still exist? Did you follow the steps on this page?

It seems that javafx is not available on the classpath at runtime. Did you install the extension https://www.eclipse.org/forums/index.php/t/1102788/ and add the following parameters to your runtime arguments at the launch configuration?

-Dosgi.framework.extensions=org.eclipse.fx.osgi
-Defxclipse.java-modules.dir=C:\Program Files\Java\javafx-sdk-11.0.2\lib (Path to your libs folder)



Regards Svenja

[Updated on: Mon, 31 August 2020 10:14]

Report message to a moderator

Re: How to - set up eclipse development with open JFX Java > 8 [message #1837208 is a reply to message #1831826] Mon, 25 January 2021 06:55 Go to previous messageGo to next message
Saravanan Ganesan is currently offline Saravanan GanesanFriend
Messages: 1
Registered: February 2016
Junior Member
Quote:
We finish Eclipse and insert the following lines below the "-vmargs" line into the eclipse.ini file ("---add-modules=ALL-SYSTEM" does not need to be re-inserted if already available):
-Dosgi.framework.extensions=org.eclipse.fx.osgi
-Defxclipse.java-modules.dir=C:\Program Files\Java\javafx-sdk-11.0.2\lib
--add-modules=ALL-SYSTEM


This piece of information has helped to get GEF User End tool to work for me.
Thank you very much.
Re: How to - set up eclipse development with open JFX Java > 8 [message #1838238 is a reply to message #1822581] Fri, 19 February 2021 08:26 Go to previous messageGo to next message
xueyao feng is currently offline xueyao fengFriend
Messages: 13
Registered: October 2020
Junior Member
i follow the procedure as you described above, so i can successfully debug and
run gef,javafx based eclipse plugin application,but when i export the plugin and install the plugin,i got errors from eclipse shown below.
my question is ,what should i do to export the eclipse plugin successfully?
Re: How to - set up eclipse development with open JFX Java > 8 [message #1838905 is a reply to message #1838238] Tue, 09 March 2021 00:36 Go to previous messageGo to next message
xueyao feng is currently offline xueyao fengFriend
Messages: 13
Registered: October 2020
Junior Member
i've already resolved this problem
Re: How to - set up eclipse development with open JFX Java > 8 [message #1860658 is a reply to message #1838905] Thu, 24 August 2023 09:02 Go to previous message
Rishabh Sharma is currently offline Rishabh SharmaFriend
Messages: 3
Registered: August 2023
Junior Member
Hi xueyao feng,

Can you please elaborate on how you resolved that problem?

Thanks and Regards,
Rishabh
Previous Topic:Running examples
Next Topic:Running GEF5 with Open JDK 17 and Open JavaFX 17 on Eclipse 4.25
Goto Forum:
  


Current Time: Thu Apr 25 21:25:23 GMT 2024

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

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

Back to the top