Running as applet on the Mac

I am having an ODEjava based project on windows that I want to run on Mac OS X.
The application runs as a (signed) applet by a regular (non admin) user.

I manage to load the odejava.jnilib to a folder on the client computer and load it into the application. However, on runtime the app tries to load the libode.dylib from /usr/lib and the problem is that my applet has no privilage to download the libode.dylib into /usr/lib in order for it to be loaded by the JNI code.

I wander if:

  • Can I specify a non-system place for libode.dylib to be placed and loaded from? how?
  • alternatively is there a way to staticly link the ode lib with the JNI code so that no dynamic loading is required?

Thanks

Sorry for refocus on this question… but, anybody have any idea on this? does this mean that I can’t use odejava in an applet running on MAC?

I also wonder that, jogl has only one “libjogl.jnilib” for opengl binding, which could be loaded right from inside an applet, can I build odejava in such a way that there’s only one “libodejava.jnilib”, which probably, I can load it the same way as I did with jogl?

Any comments are greatly appreciate, thanks :slight_smile:

well i have not used ode in java but in opengl + c, but i think that joglAppletLancher source code can help you i think, generally that jogllancher downloads all libs from server and oads them dynamically , it sores all libs in seperate foder on host machine, but it could be any location an computer, note that it downloads and load libs on its own, you said that you have signed applet so there should be no problems to operate on host machine, well maybe it will help you check that source code and try to implements it

i hope it was useful, if you will make something intresting give a link here

cheers

Thanks, kylix999, yes, I already have some codes borrowed from joglAppletLancher(before it’s released as part of “com.sun” package). I’m able to upload the native lib files for MAC(libode.dylib and libodejava.jnilib) into “user.home” folder on the client machine. The problem is, when I try to load “libodejava.jnilib” into system by calling:

System.load(“full path of libodejava.jnilib”);

It crashes the applet and displays such error: “dyld:java can’t open library: lib/libode.dylib”, and I’ve tried many places to put libode.dylib into, and it works if and only if I put it into “/usr/lib” folder which is a system folder, I don’t have previlage to write into this folder as an signed applet.

So I still have such problem. don’t know what to do…

what ?

if you try to load libodejava.jnilib error displays can not download lib/libode.dylib ? it is streange, does it occur ONLY when you try to load libodejava ? Were you able to load other libs ( libode.dylib and other… by callng system.load )?

yes, it only happens when I try to load libodejava.jnilib, I’ve tried to load libode.dylib first, no errors, but you can’t use ode without loading libodejava.jnilib, and when you load it(using System.load), the system AUTOMATICALLY load “libode.dylib” from /usr/lib folder, if it’s not there, the program will crash…

maybe you should check how loading of natives libs is made in ode from itself maybe in odejava source , becouse they had to use system.load just like you…

thanks, you remind me to check how to build jnilib and dylib on MAC. As far as I understand, dylib is needed for code reuse, it’s built from c/c++ binary code(.o files); jnilib is needed to call c function from java, just like a bridge. it’s also built from .o files. so I wonder if I can build all of the binary files into one jnilib file. that will solve my problem, I’m trying…

by the way, I made several posts using “eranb”, now I register my own ( thanks eran :slight_smile: )

Ok, I’ve successfully built libodejava.jnilib for MAC, no need for libode.dylib, this solves my problem running an odejava applet on MAC!

Thanks for your reply, kylix999.

I attached a pdf doc to show the steps of doing this, in case any one may find it helpful.