3 messages in net.java.dev.jna.usersRe: [jna-users] Setting 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:Re: [jna-users] Setting jna.library.pathActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 9, 2008 11:29:32 am
List:net.java.dev.jna.users

It's possible that you're missing paths to dependent DLLs. If this is VMWare VIX, someone's written a module for Hudson that maps to the VMWare vix library, so you might check the hudson project for an example.

On Feb 9, 2008, at 10:47 AM, Jøran Vagnby Lillesand wrote:

Hi,

thanks for your response! Yes, I tried that with no luck. Is it possible that it may be related to internal dependencies/linkages within the C library I'm using? I have very little knowledge about C myself, so I don't know how to check whether this is the case. The exception certainly indicates that the problem is related to locating the dll file itself, though...

Best regards, Jøran

Timothy Wall wrote:

Have you tried setting jna.library.path when launching the VM, e.g.

java -Djna.library.path=xyzzy

If that works, then you have an order of execution problem.

On Feb 8, 2008, at 10:42 AM, Jøran Vagnby Lillesand wrote:

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!

Best regards, Jøran Vagnby Lillesand