javaimportcommand-linelwjgl

Informing java where to import from (lib)


I'm using java from command line and coding in gedit, and am having trouble importing lwjgl.

I have my source code under src/uk/co/gossfunkel and have the lwjgl.jar in lib>jars and the natives under lib>natives. How do I let the compiler know that the import org.lwjgl.*; statement refers to org.lwjgl in lib>jars?


Solution

  • javac -cp /path/to/lib/jars/lwjgl.jar ... 
    

    for Unix.

    javac -cp c:\path\to\lib\jars\lwjgl.jar ... 
    

    for Windows.

    See http://docs.oracle.com/javase/1.3/docs/tooldocs/solaris/classpath.html or http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html for more explanations.