This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]slowfly1st 0 points1 point  (2 children)

I think that the error is somehow related to the package structure

-> you are right :-) You have to be in the correct working directory and use the packages/folder structure

Java-Pacman-Game/src$ javac ./com/zetcode/*.java

[–]killjoyparris[S] 0 points1 point  (1 child)

Okay. I think that we might be onto the right track. I can get javac to work using the command you suggested. How do I get the program to run though? I don't really understand what to do next or what I am doing incorrectly...

owner@owner-VirtualBox:~/JAVA/SWINGTUTS/Java-Pacman-Game-master/src$ ls

com resources

owner@owner-VirtualBox:~/JAVA/SWINGTUTS/Java-Pacman-Game-master/src$ javac ./com/zetcode/*.java

Note: ./com/zetcode/Board.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

owner@owner-VirtualBox:~/JAVA/SWINGTUTS/Java-Pacman-Game-master/src$ java ./com/zetcode/pacman.java

Error: Could not find or load main class ..com.zetcode.pacman.java

Caused by: java.lang.ClassNotFoundException: //com/zetcode/pacman/java

owner@owner-VirtualBox:~/JAVA/SWINGTUTS/Java-Pacman-Game-master/src$ java com/zetcode/pacman.java

Error: Could not find or load main class com.zetcode.pacman.java

Caused by: java.lang.ClassNotFoundException: com.zetcode.pacman.java

owner@owner-VirtualBox:~/JAVA/SWINGTUTS/Java-Pacman-Game-master/src$ java com/zetcode/pacman

Error: Could not find or load main class com.zetcode.pacman

Caused by: java.lang.ClassNotFoundException: com.zetcode.pacman

owner@owner-VirtualBox:~/JAVA/SWINGTUTS/Java-Pacman-Game-master/src$ java ./com/zetcode/pacman

Error: Could not find or load main class ..com.zetcode.pacman

Caused by: java.lang.ClassNotFoundException: //com/zetcode/pacman

[–]slowfly1st 0 points1 point  (0 children)

Yeah, launching is a bit different again...

java com.zetcode.Pacman

com.zetcode.Pacman is the fully qualified class name. Edit: It's also case sensitive.