Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  jogl installation: where put jogl.jar  (Read 2152 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?

thanks in advance!
Offline hvor2

Junior Member




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 Huh
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?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline hvor2

Junior Member




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

Junior Member




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

Offline aldacron

Senior Member


Medals: 9
Exp: 16 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.
Offline swpalmer

JGO Coder




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?

Offline hvor2

Junior Member




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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (48 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!