jogl installation: where put jogl.jar

some article indicates that jogl.jar should be installed to CLASSPATH.
my questions are:

  1. there is no CLASSPATH variable in my system, so where should it to be installed?
  2. should i just copy jogl.jar to the right destination or expand it then copy the generated files &dirs there?
  3. is it ok to copy natives( some .dlls) to c:\winnt\system32?

thanks in advance!

You want to execute your jar file and it has to know about jogl.jar and natives? Pack natives into jar and then,
You can add the path into manifest.mf (which is in your jar file) so it looks something like:
Manifest-Version: 1.0
Class-Path: path/jogl.jar path/natives.jar
Main-Class: yourpackage.yourMainClass

thanks but i’m still confused ???
would you give me a step-by-step instruction about the installation of jogl to me please?
currently i have downloaded jogl.jar and jogl-natives-win32.jar and that’s all. what actions should i take next?

np, earl. I was doing that with lwjgl, but principle should be the same. First tell me how do you make your .jar file and do you know how to provide your MANIFEST.MF file in it?
I was doing that through Eclipse (export tool), how about you?
If you know how to do that, then include
jogl.jar
jogl-natives-win32.jar
in the same directory as yourfile.jar.
If in MANIFEST.MF in yourfile.jar you wrote

Class-Path:jogl.jar jogl-natives-win32.jar

then java will search for those libraries after you execute
java -jar yourfile.jar
in the same directory where is yourfile.jar, and there they are.
That is basically it!

i’m a fresh new comer to Java. i would forget jogl before i have a solid mastery to the language i think.
i have no idea about manifest.mf at all. thank you any way.

MANIFEST.MF is just a file inside your jar in which you can put some important information (like path to other libraries, your main-class etc.)
Try google on it and you will find some good tutorials, for example
http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html

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.

Huh? Since when will Java load native libraries that are still packed in a jar file?

… ufff , swpalmer, you are right. I mixed it up in rushy answer with preparing natives for webstart. Thanks for correction.
Natives should be unpacked first in order to java to find them.