webstart with nativelibs

hello, when i look at some webstart files, i see that they use something called nativelib. these jars seem to contain just the nativelibraries (dlls, so, …)

example:

	<resources os="Linux">
		<nativelib href="lwjgl-native.jar"/>
	</resources>
	
	<resources os="Windows">
		<nativelib href="lwjgl-native.jar"/>
	</resources>

	<resources os="Mac OS X">
		<nativelib href="lwjgl-native.jar"/>	
	</resources>

my questions is: how do you create these nativelib-jars? is there an ant task for this?

thanks!

of course, native .jar are are common packages that may be built using jar command or ant tasks.
Those jar have to be signed with the same certificate (same person) as the main .jar that holds your jnlp app.
One single rule is necessary : all native libs must be found on the / root path of the .jar.
e.g.


 - myNative.jar
     - META-INF/
         + Manifest
     - myJNINativeLib.dll|jnilib|dylib|so
     - anotherJNINativeLib.dll|jnilib|dylib|so
     - myPackage/
       + myClass.class
     -... 

They are just zip files containing the native libs named as “.jar”. My native lib JARs don’t even contain a META-INF folder.

thank you!

one more question: how do i differentiate between 32bit and 64bit natives in the jnlp file?

You don’t, only by OS. Put both 32 and 64 bit libs in the JAR for each OS.

thanks.

(although i dont like this, cause it makes the users download stuff that they dont gonna need)

Use “arch” value:
http://lopica.sourceforge.net/os.html
If it is amd64 or x86_64, use 64-bits natives, otherwise use 32-bits natives. I don’t know if you wish to support ppc, sparc, sparcv9, etc…

However, the default JNLP file of LWJGL does not do this distinction and it works fine.