Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
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 Binaries Question  (Read 3925 times)
0 Members and 1 Guest are viewing this topic.
Offline orf102

Innocent Bystander




Java games rock!


« Posted 2003-07-11 16:10:05 »

I'm really new to openGL and Java. I'm running a box with XP and I was wondering where I'd have to put the binaries for JOGL and what I'd have to change on my system in order to use it with Eclipse. Sorry if its a stupid question, but I'm clueless at the moment.
Offline gregorypierce

Senior Devvie




I come upon thee like the blue screen of death....


« Reply #1 - Posted 2003-07-11 16:38:11 »

No biggie. I'll put a tutorial doc together this weekend to help out the newbies, but herre is the gist of it.

JOGL has two pieces: a java part, and a native part.

The jogl.jar piece has to be in you classpath. In Eclipse, IntelliJ, etc. you simply add it as a regular library. This will allow you to build your applications.

Then there is a native piece while (on Windows) will be a jogl.dll or on Linux be a jogl.so or on OSX be a libjogl.jnilib. This needs to be in your java.library.path. There are a couple of ways to put that native library in the right place. You can write a quickie program that does:

System.out.println( System.getProperty("java.library.path") );

Then look at the directories that come out and drop it there. This would be more ideal when jogl has matured a bit more or when there is an installer (in the works).

The other option is to put it into the directory where your IDE is running your application. java.library.path almost always (at least I have never run across an instance where this wasn't the case) includes "." as a directory. This means that you just need to put the native library in the directory where the application is running. For intelliJ this simply means adding the native library to the project root and it just works. This may also be the case for Eclipse as well, but since it still blows chunks on OSX (yes even 3.0 still has issues) I couldn't tell ya.

If you really just want to get up and running quickly on Windows, dump the library into your /{windows.homedirectory}/system32 directory and you're good to go. You just need to remember that you put it there because nothing will annoy you more than coming back later and installing a new version of the native piece somewhere else and having System.loadLibrary load the wrong library.

One final thing that should work, which I haven't tried with jogl is to simply do a System.load() with the absolute path to where you put the native library. I used to do this with my own native libraries on Windows and it worked, but again this is also not one of my favorite choices.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline tortoise

Junior Devvie




<3 Shmups


« Reply #2 - Posted 2003-07-11 17:23:47 »

hey, I've seen this topic before Smiley

Quote

One final thing that should work, which I haven't tried with jogl is to simply do a System.load() with the absolute path to where you put the native library. I used to do this with my own native libraries on Windows and it worked, but again this is also not one of my favorite choices.


Is it ok to go ahead and load the native libraries yourself? Does the jvm not care if someone attempts to reload an already loaded native library? Because for my app I have a lib directory I stick all these things and I'd like to be able to just load jogl along with everything else.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gregorypierce

Senior Devvie




I come upon thee like the blue screen of death....


« Reply #3 - Posted 2003-07-11 21:40:43 »

IIRC the native library will only get loaded once no matter how many times System.loadLibrary() is called. In either event, it doesn't result in an exception being through as I have just done a quick test with System.loadLibrary("jogl") being called 5 times with no apparent ill effect.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

Senior Devvie




I come upon thee like the blue screen of death....


« Reply #4 - Posted 2003-07-11 21:42:43 »

If however its smart enough to load the library multiple times but stupid enough to not throw an exception (or use a hashtable for the libraries loaded such that it unloads the one already loaded), then that deserves bug status with Sun  Grin

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #5 - Posted 2003-07-12 01:14:28 »

Who is working on the installer?  Is it an InstallAnywhere installer or something different? Is someone working on a WebStart extension installer?

8: Undefined index: online
File: /home/jgo/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 161