Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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  
  Java Web Start and Jogl...  (Read 3388 times)
0 Members and 1 Guest are viewing this topic.
Offline Preston

Senior Devvie


Medals: 4



« Posted 2003-11-28 10:18:02 »

When my Application.jar is being started with Java Web Start, it can't load the jogl native binding (jogl.dll in the case of Windows, for example). Web Start says:
1  
no jogl in java.library.path

However, if the same Application.jar ist put next to the jogl.dll on a local filesystem, a double click on Application.jar works fine as expected. (Because the java.library.path contains "." on Windows I suppose).

Of course my .jnlp file contains a native resource elements containing the jogl bins for the various platforms. When I look into the Java Web Start cache folder I see the jogl-native-xyz.jar which has been decompressed to another folder (containing the jogl.dll then).

What do I have to change so that Web Start works fine?
Offline kevglass

« JGO Spiffy Duke »


Medals: 212
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2003-11-28 10:48:13 »

Sounds like you got all the elements right.. have you got the webstart somewhere so we could take a look?

Kev

Offline Preston

Senior Devvie


Medals: 4



« Reply #2 - Posted 2003-11-28 11:01:10 »

+
Quote
Sounds like you got all the elements right.. have you got the webstart somewhere so we could take a look?


Yes, it looks like this:
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  
29  
30  
31  
32  
<?xml version="1.0" encoding="utf-8"?>
<jnlp
  spec="1.0+"
  codebase="http://www.xx.yy/user/Webstart/"
  // href="Name.jnlp">
  <information>
    <title>Name</title>
    <vendor>Me</vendor>
    <description>Well</description>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <j2se version="1.4+"/>
    <jar href="App.jar" main="true"/>
  </resources>
  <application-desc />
  <resources os="Linux">
    <nativelib href="jogl-linux.jar"/>
  </resources>
  <resources os="Windows">
    <nativelib href="jogl-windows.jar"/>
  </resource>
  <resources os="Mac OS X">
    <nativelib href="jogl-macos.jar"/>
  </resources>
  <resources os="SunOS" arch="sparc">
    <nativelib href="jogl-solaris.jar"/>
  </resource>
</jnlp>

The native JARs contain the .dll / .so / etc files, are signed and all that, like the rest.
                                                                   
Java Web Start's cache folder contains:
1  
2  
.....\P80\DMuser\DMWebstart\RCApp.jar
.....\P80\DMuser\DMWebstart\RNjogl-windows.jar\jogl.dll


Do you do some "magic" inside your main() method of the JAR? Like to include another path to the java.library.path or such?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 212
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2003-11-28 11:04:07 »

Nope, Webstart's class loader works out where the libraries are. If they're packaged properly loadLibrary() should just work (tm).

Kev

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #4 - Posted 2003-11-28 11:39:43 »

What with my game having similar problems, i'm wondering if i'm using the resource tag correctly. I keep seeing different strings used (such as  os="Mac OS X" or os="MacOS"). Is there a list of 'proper' OS strings to load native libraries with?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2003-11-28 11:58:53 »

I found an unofficial webstart FAQ: http://www.vamphq.com/jwsfaq.html#os
That seems to list the acceptable values.

Kev: Judging by this list I think the Solaris and Mac resource tags in your tutorial (and so probably in Martian Madness and S-Type) need changing.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #6 - Posted 2003-11-28 12:03:47 »

Check the JNLP of the webstart demos on the JOGL project page.  They work for me.

As for names like "Mac OS X"  these strings must match what the system property "os.name" returns... For Mac OS X this is the string "Mac OS X"..  I think you only have to match as many characters as you provide.. e.g. .startsWith(blah). so for all versions of windows you can say "Windows" and it will match "Windows 2000" "Windows XP", etc.

For resource loading and other issues see http://java.sun.com/products/javawebstart/faq.html

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #7 - Posted 2003-11-28 12:21:32 »

Yes, i noticed the partial matching thing, which is why just using "Windows" works. However i've been using one based off of Kev's tutorial which has os="MacOS" (without the space).

Solaris aside, I've updated my SType ones with a proper "Mac OS" resource tag now, perhaps that'll fix some issues.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline kevglass

« JGO Spiffy Duke »


Medals: 212
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #8 - Posted 2003-11-28 12:31:53 »

I'll update the tutorial again.. however, the MacOS tag does work, although from the explanation above... I don't know why Smiley

EDIT: Tutorial updated.

Kev

Offline Preston

Senior Devvie


Medals: 4



« Reply #9 - Posted 2003-11-28 12:33:59 »

Ok, thanks again. There are some pitfalls with Web Start...
I've changed the OS strings. The jogl.dll does also work now. No idea why it didn't before, but well, it's OK now.
Like Kev said: "however, the MacOS tag does work, although from the explanation above... I don't know why". Looks like we all don't know what Web start does exactly. ;-)


PS:  
Quote
should just work (tm).
ROFL :-)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Preston

Senior Devvie


Medals: 4



« Reply #10 - Posted 2003-11-28 13:39:50 »

Unfortunately for my free space Web site I can't change the MIME types. So if http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/setup.html suggests: "Configure the Web server so that all files with the .jnlp file extension are set to the application/x-java-jnlp-file MIME type." , this doesn't work for me.

Still, with some browsers (Opera) it's possible to click the .jnlp file on my site and everything works. On another PC with another browser (Mozilla I think) and another JRE the .jnlp file is being started but then Web Start stops with errors ("invalid Xml tags" or such).

Is there anything I can do so that it always works? Creating a Java Script? ... :-(
Offline kevglass

« JGO Spiffy Duke »


Medals: 212
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #11 - Posted 2003-11-28 13:57:35 »

You can get round this a couple of ways..

I think the vampHQ faq talks about these (its linked above).

My howto (http://www.cokeandcode.com/info/webstart-howto.html) also covers a couple of them.

Kev

Offline Preston

Senior Devvie


Medals: 4



« Reply #12 - Posted 2003-11-28 17:54:19 »

Quote
You can get round this a couple of ways..

I think the vampHQ faq talks about these (its linked above).

My howto (http://www.cokeandcode.com/info/webstart-howto.html) also covers a couple of them.

Hi Kev, thanks a lot. On the vampHQ I didn't find the MIME problem being explained (bit a lot of other things), however PHP thing of your nice and short Howto does do the trick.
I've added the two lines and renamed the .jnlp to .php and it looks like it works (for me and another PC, too). That would be cool. Have to test further but hey presto.  Presto? Preston.


PS: Your Howto's ClassLoader on static classes is pretty usefull, too.
Offline Preston

Senior Devvie


Medals: 4



« Reply #13 - Posted 2003-12-04 17:41:51 »

Say you would like to use this yet unofficial sun.misc.Perf high-res timer (an equivalent one with another name will be there in J2SE 1.5), which is hidden in the J2SE 1.4.2 . Would the following line in the .jnlp do the trick?
1  
2  
3  
<resources>
  <j2se version="1.4.2+"/>
  ...

(How to specify a micro version number is explained here: http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html#resources )

Or does "unofficial" mean the high-res timer is just in the Win32 J2SE 1.4.2 but not in the Linux, Mac, ... one?
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #14 - Posted 2003-12-05 01:18:59 »

I don't think that will work.  I thought the '+'  ('this version and newer') could only be used with one dot, like 1.3+ or 1.4+ .. but not 1.3.0+
You can use '*'  so anything beginning with 1.4.2 is 1.4.2*  .. which won't match 1.5, but you could have a separate section in the JNLP that had 1.5+

Offline cfmdobbie

Senior Devvie


Medals: 1


Who, me?


« Reply #15 - Posted 2003-12-05 08:01:38 »

Sounds like an RFE on the way...? Roll Eyes

Hellomynameis Charlie Dobbie.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #16 - Posted 2003-12-06 00:31:53 »

I think the idea is that your code should generally require only a particular major release, but not be so picky about maintenance releases.  If it is that picky then you can specify the exact release.  I don't think the mechanism was intended to pick out unsupported details in the sun.* packages, since a release with the same version # does not need to implement unsupported sun.* code.

E.g. the mac version of 1.4.2 may have problems if the hi-res timer is not there, but you see version 1.4.2 and assume it is. It would be better to check if is there by catching the exception if it is missing and fall back to a supported option. (not for every call to use the timer... just once to decide which implementation to assign to your timer interface.)

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #17 - Posted 2003-12-08 01:25:22 »

sorry for not seeing this topic earlier.

I've written a small tutorial on the subject and have a good way of taking Kev's mime-type stuff further so that the files still end in ".jnlp" (by using .htaccess and mod_rewrite).

http://xith.org/tutes/GettingStarted/html/deploying_xith3d_games_with.html

The tutes for Xith3d, for which the JOGL libraries are a subset.

Ignore my OSX string - that's been fixed for the real demo but not updated in the code (I must do that now).

Will.

Offline Preston

Senior Devvie


Medals: 4



« Reply #18 - Posted 2003-12-10 12:04:17 »

Quote
sorry for not seeing this topic earlier.

Such happens to me all the time because of that "view 10 recent postings" limit...
:)

The Xith tutorial on Webstart is nice, thank you. I've already applied Kev's PHP trick to my Jnlp file. For some friends this worked then. However there are still some who say it doesn't work. Somehow even the .php Webstart file isn't regonized by their browser and they obtain an corrupted .jnlp file with corrupted newlines and so their native Webstart complains about missing tags, etc.
Is there something I can do against this? I've to add I'm on one of those free web space providers (they suck, usually, I know)... Would a small example with URL help?
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.

rwatson462 (38 views)
2014-12-15 09:26:44

Mr.CodeIt (31 views)
2014-12-14 19:50:38

BurntPizza (62 views)
2014-12-09 22:41:13

BurntPizza (99 views)
2014-12-08 04:46:31

JscottyBieshaar (60 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

toopeicgaming1999 (138 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (38 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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