Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (563) Games in Android Showcase (151) games submitted by our members Games in WIP (605) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 jogl installation: where put jogl.jar  (Read 2339 times) 0 Members and 1 Guest are viewing this topic.
earl
Guest
 « Posted 2006-01-19 09:13:58 »

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?

hvor2

Junior Devvie

Beyond mind, there is an awareness...

 « Reply #1 - Posted 2006-01-19 09:26:43 »

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

earl
Guest
 « Reply #2 - Posted 2006-01-19 09:42:33 »

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?
hvor2

Junior Devvie

Beyond mind, there is an awareness...

 « Reply #3 - Posted 2006-01-19 09:48:31 »

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
 1 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!

earl
Guest
 « Reply #4 - Posted 2006-01-19 10:02:05 »

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.
hvor2

Junior Devvie

Beyond mind, there is an awareness...

 « Reply #5 - Posted 2006-01-19 10:05:00 »

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

aldacron

Senior Devvie

Medals: 10
Exp: 17 years

Java games rock!

 « Reply #6 - Posted 2006-01-19 11:57:05 »

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.
swpalmer

JGO Coder

Exp: 12 years

Where's the Kaboom?

 « Reply #7 - Posted 2006-01-20 01:29:46 »

jogl.jar
jogl-natives-win32.jar
in the same directory as yourfile.jar.
If in MANIFEST.MF in yourfile.jar you wrote
 1 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!

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

hvor2

Junior Devvie

Beyond mind, there is an awareness...

 « Reply #8 - Posted 2006-01-20 09:10:56 »

... 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.

Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 wxwsk8er (49 views) 2015-03-20 15:39:46 Fairy Tailz (42 views) 2015-03-15 21:52:20 Olo (26 views) 2015-03-13 17:51:59 Olo (29 views) 2015-03-13 17:50:51 Olo (33 views) 2015-03-13 17:50:16 Olo (40 views) 2015-03-13 17:47:07 ClaasJG (29 views) 2015-03-10 11:36:42 ClaasJG (37 views) 2015-03-10 11:33:01 Pippogeek (45 views) 2015-03-05 14:36:23 Pippogeek (37 views) 2015-03-05 13:56:12
 LiquidNitrogen 23x KevinWorkman 22x BurntPizza 21x basil_ 21x theagentd 18x Riven 18x EgonOlsen 17x Roquen 14x princec 12x SHC 9x Varkas 9x Slyth2727 9x NegativeZero 9x ClaasJG 7x Ecumene 7x teletubo 7x
 How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org