4

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?

1 Answer 1

3

You need a JVM for Java 8 that comes bundled with a copy of the JavaFX libraries.

A few vendors provide that.

  • Azul Systems is one such vendor. See this company blog post describing their ZuluFX product, an implementation of Java 8 as well as later versions of Java.
  • LibericaFX from BellSoft is another such offering.

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.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.