I am not a developer. Having OpenJDK and javafx installed, environment 'path' variable set, I am trying to launch and use a java based windows desktop tool that currently runs with Oracle JDK 1.8
Since Oracle JDK is licensed for commercial use, I am trying to find out if OpenJDK 8 could be a good alternative. (Note: All other Java based applications in our environment are based on Java 1.8. So we cannot look beyond OpenJDK 8)
What I Tried! I downloaded AdoptOpenJDK 8 and unzipped it in a local directory. I set the System Path variable to respective JDK/bin folder. Tried to launch our java based tool and received the below error for missing javafx component. Repeated same steps with the other OpenJDK 8 options.
Exception in thread "UI:MainUI" java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
Caused by: java.lang.ClassNotFoundException: javafx.embed.swing.JFXPanel
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
Since javafx is inbuilt in Oracle JDK we dont get this error when using it. But getting the same error for all the OpenJDK 8 that I tried (Oracle OpenJDK 8, AdoptOpenJDK 8, Zulu OpenJDK 8, Libertica OpenJDK 8).
Trying to find out if I can install OpenJFX or javafx in a separate directory along with OpenJDK 8 and launch my tool. Or is there any other option to look at for launching/using the tool with OpenJDK 8 installed instead of Oracle JDK?
You need a JVM for Java 8 that comes bundled with a copy of the JavaFX libraries.
A few vendors provide that.
Understand that both of those vendors provide two variations of their implementations of Java: one without JavaFX and one with JavaFX. Be sure you are accessing the right one for your needs.
Here is a flowchart I made as guidance in choosing a Java vendor.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With