Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 439 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Trouble running JavaBallPuzzle. It doesn't run

I am getting this error.
It is in portuguese...
[email protected] #>java -jar JavaPuzzleBall.jar
Erro: Não foi possível localizar nem carregar a classe principal javafxapplication01.JavaPuzzleBall
Causada por: java.lang.NoClassDefFoundError: javafx/application/Application
I am with openJDK10.0.1 in Ubuntu 18.04.
Help please.
Answers
-
That is really strange. Let me investigate. In the meantime, I have heard of incidences where the game won't run on OpenJDK, but will run on OracleJDK.
-
Thanks.
Maybe it is the point.
I also installed Oracle JDK.
I will keep trying.
-
I'm able to get the game to work on Java 10. Is your system using the runtime environment that comes with the Oracle JDK? I don't believe OpenJDK includes a corresponding JavaFX implementation (OpenJFX) by default, which means you'd have to install additional packages to get the game to work using OpenJDK.
-
I'm also on 18.04, and the game doesn't run for me on openjdk 10. This is what I did:-
sudo apt install openjdk-8-jdk openjfx
sudo update-alternatives --config java
From this menu, choose Java version 8 and then you should be able to run with:-
java -jar JavaPuzzleBall.jar
-
It worked!
Great!
Thanks for the help of you all.
-
I seem to be having the same problem running the Jar:
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (Zulu 8.21.0.1-macosx) (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (Zulu 8.21.0.1-macosx) (build 25.131-b11, mixed mode)
java -jar JavaPuzzleBall.jar
Error: Could not find or load main class javafxapplication01.JavaPuzzleBall
Any ideas ?
-
Hi Lee,
The culprit is OpenJDK. OpenJDK doesn't include a JavaFX counterpart by default. One option is to install additional OpenJFX packages to make up the difference. Or another option is to install and run the game with Oracle's JRE.
Nick
-
Hi, sorry I got to this great course late.
I have problems with running the game as well. Any idea ? Thanks.
c:\userdata\!>java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
c:\userdata\!>java -jar c:\userdata\!\JavaPuzzleBall.jar
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Input stream must not be null
at javafx.graphics/javafx.scene.image.Image.validateInputStream(Unknown Source)
at javafx.graphics/javafx.scene.image.Image.<init>(Unknown Source)
at javafxapplication01.JavaPuzzleBall.init(JavaPuzzleBall.java:49)
at javafxapplication01.JavaPuzzleBall.start(JavaPuzzleBall.java:189)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
... 1 more
Exception running application javafxapplication01.JavaPuzzleBall
-
the above example is in Windows 10.
While ago I tried it in Virtual Box - Oracle DB Developer VM, and it works ( but it is slower ).
I would appreciate to make in run on Win10 as well, but it is not urgent.
Thank you.
Libor.
-
That's a new one. I'll have to see if I can reproduce it. Is anyone else having trouble on Windows 10?