Preston
|
 |
«
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?
|
|
|
|
kevglass
|
 |
«
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
|
|
|
|
Preston
|
 |
«
Reply #2 - Posted
2003-11-28 11:01:10 » |
|
+ 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/" <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!
|
|
kevglass
|
 |
«
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
|
|
|
|
Orangy Tang
|
 |
«
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?
|
|
|
|
Orangy Tang
|
 |
«
Reply #5 - Posted
2003-11-28 11:58:53 » |
|
I found an unofficial webstart FAQ: http://www.vamphq.com/jwsfaq.html#osThat 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.
|
|
|
|
swpalmer
|
 |
«
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
|
|
|
|
Orangy Tang
|
 |
«
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.
|
|
|
|
kevglass
|
 |
«
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  EDIT: Tutorial updated. Kev
|
|
|
|
Preston
|
 |
«
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: should just work (tm). ROFL :-)
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Preston
|
 |
«
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? ... :-(
|
|
|
|
|
Preston
|
 |
«
Reply #12 - Posted
2003-11-28 17:54:19 » |
|
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.
|
|
|
|
Preston
|
 |
«
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?
|
|
|
|
swpalmer
|
 |
«
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+
|
|
|
|
cfmdobbie
Senior Devvie    Medals: 1
Who, me?
|
 |
«
Reply #15 - Posted
2003-12-05 08:01:38 » |
|
Sounds like an RFE on the way...? 
|
Hellomynameis Charlie Dobbie.
|
|
|
swpalmer
|
 |
«
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.)
|
|
|
|
William Denniss
|
 |
«
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.htmlThe 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.
|
|
|
|
Preston
|
 |
«
Reply #18 - Posted
2003-12-10 12:04:17 » |
|
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?
|
|
|
|
|