Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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 3690 times)
0 Members and 1 Guest are viewing this topic.
Offline orf102

Innocent Bystander




Java games rock!


« Posted 2003-07-11 18: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 Member




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


« Reply #1 - Posted 2003-07-11 18: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 Member




<3 Shmups


« Reply #2 - Posted 2003-07-11 19: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 Member




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


« Reply #3 - Posted 2003-07-11 23: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 Member




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


« Reply #4 - Posted 2003-07-11 23: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




Where's the Kaboom?


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

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

Archimedes
Guest
« Reply #6 - Posted 2003-07-12 05:23:20 »

If you want to have got Jogl in your JRE (JDK) just put the two files here:
1  
2  
Jre/bin/jogl.dll
Jre/lib/ext/jogl.jar


The two files can be found here: http://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=128

If you want to give your application as a JAR file to somebody else, just put the two files next to your JAR. For example:
1  
2  
3  
Myapplication.jar
jogl.dll
jogl.jar


Then a double click on your Myapplication.jar or the usual "java -jar Myapplication.jar" will do the job.
(It's not neccessary to set any classpath variable in the Win32/dosbox environment).


P.S. The point I don't understand is why I haven't to include the "." into the classpath of Java. I could bet I had to do so with Java 1.1.x in former times. Is this some "magic" in Java 1.4.2 to automatically always search the "." directory, too? Btw, there really is no CLASSPATH variable set here. :-)
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #7 - Posted 2003-07-12 06:00:27 »

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


We just got the certificate today which will allow us to post signed jars that developers can link to directly in their Java Web Start JNLP files. This should be the most automatic form of installation and distribution. Will work on getting these up next week.
Offline gregorypierce

Senior Member




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


« Reply #8 - Posted 2003-07-12 15:07:17 »

I am working on an Installer for installing the native libraries as we speak in order to allow these libraries to be just like good old native libraries and accessible (I expect) from a web browser just like Flash.

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 Themroc

Junior Member





« Reply #9 - Posted 2003-07-12 15:13:28 »

Quote
We just got the certificate today which will allow us to post signed jars that developers can link to directly in their Java Web Start JNLP files. This should be the most automatic form of installation and distribution. Will work on getting these up next week.

That is very good news! I like JOGl more and more.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gregorypierce

Senior Member




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


« Reply #10 - Posted 2003-07-12 15:40:25 »

Note installer uses Install Anywhere 5.5.

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




Where's the Kaboom?


« Reply #11 - Posted 2003-07-13 02:05:55 »

Quote
We just got the certificate today which will allow us to post signed jars that developers can link to directly in their Java Web Start JNLP files.


If the JOGL jar file is signed by your certificate and my code is signed by my certificate that means the user must confirm that they want to allow each component to have full access to the system in two separate security dialogs - right?

I would like to see a Web Start extension installer as well, so that JOGL can be installed on a system once, then every other Web Start app that needs it won't even need to download it as long as it is up to date.

How will the Mac version deal with systems that don't have OpenAL installed?  Will users need to install it separately?

Offline gregorypierce

Senior Member




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


« Reply #12 - Posted 2003-07-13 03:52:24 »

JOAL hasn't gotten the special treatment that JOGL has, but OpenAL is a native library just like libjogl.jnilib and can be installed in a similar manner. Its just a openal.framework that needs to be plopped into the frameworks directory. No funky registry idiocy and the like. OSX makes installing software easy. if you can figure out where its supposed to go, just move the file there Smiley

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




Where's the Kaboom?


« Reply #13 - Posted 2003-07-13 13:30:15 »

I only mention OpenAL because when I ran the installer for it, it placed the framework in /Library/Frameworks/  whereas most of the OS X frameworks seem to go to /System/Library/Frameworks.  When working on OpenAL support in LWJGL I couldn't find a OS X API that returned the /Library/Frameworks path and had trouble loading the framework until I moved it.

I think it makes sense to install the OpenAL framework in a manner consistent with the OpenAL installer.. so that things don't get messed up with multiple copies of the same framework.

Offline gregorypierce

Senior Member




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


« Reply #14 - Posted 2003-07-13 18:51:03 »

With most things for OSX it depends on whether or not you are running as root or a user with true root permissions. If you're not running as root it will not try to install anything into a system directory because your user account wouldn't have permission to do so anyways. As such it installs them into the user libraries (a good architectural approach) directory. It might be worthwhile to bring that up with the OpenAL folks.

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 Ken Russell

JGO Coder




Java games rock!


« Reply #15 - Posted 2003-07-14 11:14:06 »

Quote


If the JOGL jar file is signed by your certificate and my code is signed by my certificate that means the user must confirm that they want to allow each component to have full access to the system in two separate security dialogs - right?

I would like to see a Web Start extension installer as well, so that JOGL can be installed on a system once, then every other Web Start app that needs it won't even need to download it as long as it is up to date.


The intent is to have it referenced as a Web Start extension as you suggest so that it is shared among applications and has its own security domain. Note that this implies that end-user applications wouldn't necessarily need to be signed. I don't know exactly how to do this yet but will try to figure it out this week.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #16 - Posted 2003-07-14 13:06:12 »

I think you will want something like this.. (once the installer is ready for each platform)
This jnlp file would be referenced from the applications jnlp file as an extension installer.  I think the os string for Mac will need to be modified to only recognize OS X 10.3 and above, unless a 10.2 compatible version of JOGL is produced.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://games.dev.java.net/blah" href="JOGL.jnlp">
      <information>
            <title>JOGL</title>
            <vendor>Game Technologies Group, Sun Microsystems inc.</vendor>
            <homepage href="index.html"/>
            <description kind="short">Native bindings for OpenGL</description>
            <description>This extension privides access to OpenGL functions from Java.</description>
            <icon href="images/jogl_logo.jpg"/>
            <offline-allowed/>
      </information>
      <security>
            <all-permissions/>
      </security>
      <resources os="Windows">
            <j2se version="1.4+"/>
            <jar href="JOGLInstallWin.jar"/>
      </resources>
      <resources os="Linux">
            <j2se version="1.4+"/>
            <jar href="JOGLInstallLinux.jar"/>
      </resources>
      <resources os="Mac OS">
            <j2se version="1.4+"/>
            <jar href="JOGLInstallMac.jar"/>
      </resources>
      <installer-desc main-class="MainInstall"/>
</jnlp>

Offline gregorypierce

Senior Member




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


« Reply #17 - Posted 2003-07-14 19:19:36 »

You bring up an interesting issue as I'm not sure its possible to recognize a specific version of the OS in WebStart for OSX. Sounds like an RFE for the Panther folks.

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

pw (13 views)
2014-07-24 01:59:36

Riven (11 views)
2014-07-23 21:16:32

Riven (12 views)
2014-07-23 21:07:15

Riven (13 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!