How to programmatically load librxtxSerial in Java

I started to play with arduino an interfacing it with Java, it was pretty straightforward, but now I would like to programmatically load the librxtxSerial native lib, and I can’t figure out.
Since I’m on MacOS 64bit and use Java6 I used the following jnilib : as recommended here :

After that I tried to load it programmatically like this :

  * Loads the jnilib
public static void loadJniLib() {
	// loads the jnilib from the source folder "src/main/resources"
	URL url = Demo.class.getResource("/librxtxSerial.jnilib");
	try {
	catch (UnsatisfiedLinkError unsatisfiedLinkError) {
		// native code library failed to load.

Which seems to works (at least does not throw an exception).

But when I call the CommPortIdentifier.getPortIdentifier(PORT_NAME); it throws the following exception:

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
	at java.lang.ClassLoader.loadLibrary(
	at java.lang.Runtime.loadLibrary0(
	at java.lang.System.loadLibrary(

So I do not understand what’s wrong, since it seems to be the right way to load it according to :

Any idea?

PS : You can find the whole code here : which works provided the rxtx jar is in the classpath and the native library location is defined (like this in Eclipse :