• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error: Could not find or load main class GameTester  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys!
I was trying to write my own version of the game SimpleDotCom from Head First Java. I have two files:
Game.java:

GameTester.java:

The two files are in the same directory, "project_01" and the CLASSPATH environment variable is set to ".;".
The game compiled but when I tried launching it with "java GameTester" it returned the error : Could not find or load main class GameTester.
I know my game is horrible and probably extremely buggy but I'll fix all the bugs, etc. later, right now I just need to get it to run.

Thanks.
 
Sheriff
Posts: 11498
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to change directory to the parent of project_01 then run java project_01.GameTester
 
Oak LeGrib
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:Try to change directory to the parent of project_01 then run java project_01.GameTester

It worked! Thanks!
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to read up on "pacakges" in java.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!