0

I have installed oracle jdk1.8.0_131 on debian and also bluej. When I try to run it via Gui it doesn't start. When I tried to run it via terminal it gave an error:

Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Ap
plication
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 13 more 

Edit: Output of sudo update-java-alternatives --list

java-1.8.0-openjdk-armhf 1063 /usr/lib/jvm/java-1.8.0-openjdk-armhf
java-8-oracle 1081 /usr/lib/jvm/java-8-oracle

and java -version

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode)
  • How did you run it at did you make sure all the libraries are in the classpath? – f1sh Aug 02 '17 at 08:43
  • If you are asking about $JAVA_HOME and $PATH then yes. – Baidyanath Kundu Aug 02 '17 at 08:47
  • Install `openjfx`. See linked (possible duplicate) question. – Itai Aug 02 '17 at 08:57
  • Alternatively, if you want to use the oracle JRE (which should contain JavaFX libraries), use `update-alternatives` and make sure it is the default java. – Itai Aug 02 '17 at 08:58
  • Offtopic: BlueJ are not a good tool to learn java. It damage the way you program in reality. I would suggest go for netbeans or any other IDE. – Christian Moen Aug 02 '17 at 09:03
  • BlueJ, seriously? Get a proper IDE like IntelliJ. – Juvanis Aug 02 '17 at 09:10
  • Yeah I know that but it is for my school. Doesn't jdk contain jre. If yes how do i set alternatives for jre(I had done it for java and javac)? – Baidyanath Kundu Aug 02 '17 at 09:28
  • Can you include the output of running `sudo update-java-alternatives --list` as well as `java -version`? You can use `sudo update-java-alternatives --set [name]` where `[name]` is the name of the Oracle JRE given by the first command, if it is not already shown as the default. – Itai Aug 02 '17 at 11:41
  • Included the outputs of the cmds – Baidyanath Kundu Aug 02 '17 at 17:07
  • Ah, it seems you are using an ARM architecture. The Oracle site mentions JavaFX was removed from the ARM version since 8u33, so this is why it is not included. You should probably remove the Oracle JRE and install `openjfx` - Debian has an OpenJFX package for ARM as well. – Itai Aug 03 '17 at 09:16
  • How to install openjfx? apt-get cant find the package. – Baidyanath Kundu Aug 03 '17 at 17:52

0 Answers0