Trouble running outside of eclipse

Hey,

I am having trouble running a jogl project outside of eclipse and was wondering if someone could give me some help.

When I try to just run the Jar I get:

Exception in thread “main” java.lang.NoClassDefFoundError: javax/media/opengl/GL
EventListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.chaopsychochick.insectGame.impl.gui.InsectGameGuiFactoryImpl.crea
teGameGui(InsectGameGuiFactoryImpl.java:17)
at com.chaopsychochick.insectGame.main.InsectMainGame.main(InsectMainGam
e.java:26)

I was wondering, how do I set/add to the library path, or where do I need to put the .dll’s?

I appreciate any help.

Thanks

Specify -Djava.library.path=/absolute/or/relative/path/to/directory/containing/DLLs.

Besides the option that Ken mentions in his reply I think you will also need to add the jogl.jar to your class path, eg:

-cp /absolute/or/relative/path/to/jogl.jar

And in addition to quintesse’s advice, be aware that if your application is packaged in a jar itself, the -jar flag of the java command will cause any classpath settings to be ignored.
Option 1 is to include the jogl classes inside your own jar and continue using the -jar flag
Option 2 is to do something like java -cp /path/to/jogl.jar:path/to/your/jar.jar foo.bar.YourMainClass
Option 3 is to add an entry in your jar file’s manifest that adds the jogl jar to the classpath

edit: Added additional advice to my own additional advice. Oh the humanity! Where will it all end?