'Configure Java VM of Eclipse to run with JavaFX

I would like to know if it is possible to configure the Java VM used by Eclipse to run in this way, that it uses JavaFX SDK libraries.

Please be aware! I don't want to build JavaFX applications on my own in Eclipse, e.g. by using E(fx)clipse or other plugins. Another remark: I don't use Java development perspective in Eclipse or a Java project. So it won't work to add the external .jars of JavaFX as user libraries!

In my use case I have an third-party GUI application based on JavaFX that has to be started out of Eclipse. If I try to start this application I receive the following error:

The system reqirements are not met. Could not find: javafx.properties in: /Applications/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86_64_17.0.2.v20220201-1208/jre/lib Your Java Virtual Machine seems not to support JavaFX, required to run the XXX. Please make sure you provide a valid path to the Java FX modules during gui installation.

As you can see by the error message my Eclipse runs on a MacOS x64 system. But I think the way to configure the VM of Eclipse should work on each system the same way.

Thank you.

Steve



Solution 1:[1]

If you have a third-party GUI application, then you do not need an IDE like Eclipse.

Ideally the publisher of your app would have provided the app as a package that includes the JavaFX/OpenJFX libraries as well as all the parts of a JDK/JVM needed to run that app on your Mac.

If the publisher gave you only the bare-bones app without the needed libraries & JDK/JVM, you can obtain a JDK/JVM bundled with those libraries.

At least two vendors supply a JDK with JavaFX/OpenJFX libraries:

  • ZuluFX by Azul Systems
  • LibericaFX by BellSoft

Both are available free-of-cost with optional support plans available for sale. Download either product as an installer specific to your Mac, while paying attention to either Intel-based Mac or Apple Silicon (ARM, AArch64) based Mac.

You can verify the install by using a console such as Terminal.app to run:

java --version

… and:

which java

You can also use the Finder to locate your installed JVMs by choosing Go > Go to Folder… where you paste:

/Library/Java/JavaVirtualMachines

If your app contains the necessary MANIFEST.MF file, you may be able to launch your app by double-clicking. If not, use a console such as Terminal.app with the java command to launch the app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1