LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: brain56 on August 15, 2011, 09:36:53

Title: LWJGL cannot find class error when using "java <class file>" command
Post by: brain56 on August 15, 2011, 09:36:53
I successfully compiled my source using this command:

    javac -classpath "..\lwjgl-2.7.1\jar\lwjgl.jar" Game.java

However, when I try to run it using:

    java -classpath "..\lwjgl-2.7.1\jar\lwjgl.jar" Game

, it gives me an error:

    Error: Could not find or load main class Game

What have I done wrong!? :(

I am certain that there are no syntactical errors and class labeling anomalies.

I've also tried running the program using this command, but still nothing. T.T
   
     java -cp "..\lwjgl-2.7.1\jar\lwjgl.jar" -Djava.library.path="..\lwjgl-2.7.1\native\windows" Game
Title: Re: LWJGL cannot find class error when using "java <class file>" command
Post by: kulpa on August 15, 2011, 13:11:55
Game.class is not in your classpath!

Add the current working directory to classpath.

java -cp "..\lwjgl-2.7.1\jar\lwjgl.jar;." -Djava.library.path="..\lwjgl-2.7.1\native\windows" Game

(added . to cp)