Off topic: asking for some advice, since this loader sounds close to what I want. The problem: I need to use a huge C++ codebase that is developed on the Mac, and is used to generate a shared library used in a Java app with JNI, SWIG, and loaded with loadLibrary. It would be fantastic to be able to build a shared library on the Mac, and be able to use it on both Macs and Linux servers. Maintaining and building 2 versions is a nuisance. (A complete build takes a couple of hours, even on a fast box.) Probably not possible because shared libraries are very different on OS X and Linux, but long term it would save me a lot of time if it is, even if I had to patch the Linux JVM.