3 messages in net.java.dev.jna.usersSetting jna.library.path
FromSent OnAttachments
Jøran Vagnby LillesandFeb 8, 2008 7:41 am 
Timothy WallFeb 8, 2008 8:26 am 
Timothy WallFeb 9, 2008 11:29 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Setting jna.library.pathActions...
From:Jøran Vagnby Lillesand (lill@stud.ntnu.no)
Date:Feb 8, 2008 7:41:48 am
List:net.java.dev.jna.users

Hi!

I'm having some problems making the "jna.library.path" parameter work. I've tried setting it both absolutely and relative to the working directory, but it fails none the less. If I set the working directory to the directory containing the library I'm trying to use, it works fine, so I reckon the problem is that it isn't properly added to the search path. I've tried reviewing the JNA code, but I'm unable to see where the parameter is supposed to be added to the search path.

The exception is as follows:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'vix': The specified module could not be found.

at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157) at com.sun.jna.Library$Handler.<init>(Library.java:123) at com.sun.jna.Native.loadLibrary(Native.java:259) at com.sun.jna.Native.loadLibrary(Native.java:245)

(calls within my own classes has been omitted).

I set the path as follows: System.setProperty("jna.library.path", "c:\\workspace\\project\\lib\\");

And I load the instance as follows: VixInterface INSTANCE = (VixInterface) Native.loadLibrary("vix", VixInterface.class);

I hope this sufficiently describes the situation!