1

Distribution is Kali Linux Java11 is installed:

java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Debian-3)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3, mixed mode, sharing)

Openjfx is also installed:

apt policy openjfx
openjfx:
  Installed: 11.0.2+1-1
  Candidate: 11.0.2+1-1
  Version table:
 *** 11.0.2+1-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
        100 /var/lib/dpkg/status

However, when I want to start something using Java11 that requires OpenJFX it wont work.

Also, how do I install OpenJFX for Java8? With

sudo apt install openjfx

I only get openjfx for Java11

When I want to start something using Java that includes openjfx:

java -jar file.jar

Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 13 more
  • 2
    Is this a duplicate of unix.stackexchange.com/q/505130/117549? – Jeff Schaller Mar 11 at 12:56
  • More likely a following question as I didn't know what the issue was. Now I'm aware it's openjfx not being found by java11 and I'm not sure how to include it. – Ja Bush Mar 11 at 13:05
  • 1
    I mention it because it seemed like Romeo had a solution that you were going to test and reply back with. The bulk of the question seems (to me) identical. – Jeff Schaller Mar 11 at 13:06
  • I didn't figure out how to add the path though and still am stuck with the same Problem... – Ja Bush Mar 11 at 13:20
  • @JaBush, this is not a reason to ask new question. Just add comment in the first question – Romeo Ninov Mar 12 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.