Executable JARs

I’m not sure if the two are related but I’ve written an AVL app using JOGL and when I try to make an excutable JAR I get the error “Could not find the main class. Program will exit” If I run my app without loading my glcanvas it works fine other than the fact that I no longer have my canvas. Has anyone else had any problems like this? Is there something special I have to do when packaging my app into a JAR file? Any help is appreciated.

I should also note that when i run it from a command line like, “java -jar App.jar”, it works fine. I only get the error message when I double click the jar file.

I don’t have much experience with packaging JOGL apps (or any others for that matter) but I can imagine two things that might happen here:

  • does double-clicking the JAR use the same JDK as running the app from the command line?

  • might the app still be getting files from the local folder when run from the command line? (test by copying the JAR to a completely folder and starting it there, also making sure that there’s no CLASSPATH defined which might mess up the test as well)