hvor2 is describing how to set up an executable jar file. Unfortunately, this is not reliable. Also, you don’t need to expand the jogl jar to install it. There are two scenarios to consider - development and distribution.
For development, it doesn’t matter where on your system you keep the jar files. Any IDE you use will automatically configure a class path for you (don’t worry about the CLASSPATH environment variable - it’s generally considered a bad idea to use it these days). Your IDE will also allow you, somewhere in general and/or project options, to add libraries to and remove them from the classpath. To launch the application, the path to any required native libraries will need to be passed to the VM as a command line parameter: -Djava.library.path=“C:\path\to\natives” (no quotes required). Your IDE will also allow you to configure that somewhere in the project options. If you are not using an IDE you will have to do everything from the command line. To compile, you will need to pass the classpath to javac yourself, and to run you will need to pass the classpath and the native library path to the VM (see below).
For distribution you will need to launch the VM with the classpath command line argument as well as the path to the natives. There are many ways to handle this. Two common ways are using a shell script (such as a batch file on Windows) to launch the program or have your installer configure the correct command line in a desktop shortcut. Assuming your classes are in a subdirectory called “jars” and your natives in a subdirectory called “natives”, then from the application directory your command line might look like this:
javaw -cp .;jars -Djava.library.path=./natives MyApp
Multiple directories on the classpath should be separated by a semicolon ( ; ) on Windows and a colon ( : ) on Unix-based systems. You should always include the current directory (.) as a matter of course.
EDIT: grrr - silly smilies replaced my semicolon and colon.