Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 240 Big Data Appliance
- 1.9K Data Science
- 450.4K 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
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187.1K 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
- 443 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
How do you run Java Puzzle Ball ?

I've downloaded the JavaPuzzleBall jar file and now I'm trying to run it.
I've tried
java -jar JavaPuzzleBall.jar
java -cp JavaPuzzleBall.jar javafxapplication01.JavaPuzzleBall
I've tried extracting the contents of the jar file into a directory and then, from this directory, running
java -cp . javafxapplication01.JavaPuzzleBall
I've tried all the above using -classpath instead of -cp
In all cases the response I get is
Error: Could not find or load main class javafxapplication01.JavaPuzzleBall
I can see the JavaPuzzleBall.class file in the jar file in the correct location and when I extracted the contents it was there in the javafxapplication01 directory.
I've downloaded the jar file three times in case it had been corrupted, but still the same result.
Any ideas what the problem may be ?
Stuart
Answers
-
Hi Stuart,
I remember encountering a bug like this before. I think my problem was that I hadn't set an environment variable properly on the machine I was using. One indication that this might be the problem is if the error occurs with other .jars. Are you able to run other jars on your machine?
Nick
-
Yes. Created a jar with a simple Hello World program and ran it from the same directory as the PuzzleBall jar
java -jar Test.jar
Hello World!
java -jar JavaPuzzleBall.jar
Error: Could not find or load main class javafxapplication01.JavaPuzzleBall
-
I have two Java Virtual Machines 8 and 9, the game works for me only with java 8, Whats your JVM? you can know that with the command java -version.
I did this
$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
$ java -jar JavaPuzzleBall.jar
-
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
Could it be because I'm using openJDK instead of Oracle JVM ?
-
Strange... I'll see if I can get some advice on this.
-
I had same problem on Ubuntu with openJDK. Installed Oracle JDK and it works fine now.
-
If you are using gentoo javafx useflag should be enabled.
-
I have the following java JDK's implemented:
To execute I simply double click on the JavaPuzzleBall jar file.
No problem.
No environment variable mods to run the puzzleball game. Only needed mods which Nick and mNem helped me with to perform command line compiling using Java 8 and 9.
-
Here is my solution solution,
I am using Windows 10 OS.
Make sure you are using JDK 1.8 and download the game from the following link:
https://apexapps.oracle.com/pls/apex/f?p=44785:112:118335702021467::::P112_CONTENT_ID:19394
After downloading just double click on the JavaPuzzleBall.jar file or you can run through the cmd command, type java -jar JavaPuzzleBall.jar, (C:\Users\computername\Downloads>java -jar JavaPuzzleBall.jar)
I hope this helps.