11 messages in net.java.dev.jna.usersRe: [jna-users] NativeLibrary Usage
FromSent OnAttachments
Christine GrudeckiJul 26, 2007 7:11 am 
Timothy WallJul 26, 2007 8:35 am 
Christine GrudeckiJul 26, 2007 12:52 pm 
Timothy WallJul 26, 2007 1:21 pm 
pzab...@poczta.onet.plJul 27, 2007 8:57 am 
Timothy WallJul 27, 2007 11:24 am 
Timothy WallJul 30, 2007 3:41 am 
Timothy WallJul 30, 2007 7:54 am 
Timothy WallJul 30, 2007 8:58 am 
Christine GrudeckiJul 30, 2007 9:24 am 
Timothy WallJul 30, 2007 10:49 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] NativeLibrary UsageActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jul 27, 2007 11:24:53 am
List:net.java.dev.jna.users

On Jul 27, 2007, at 11:57 AM, pzab@poczta.onet.pl wrote:

Hi,

I am trying to do this:

public abstract class testJNALibHelper implements Library {

This needs to be an interface, not an abstract class.

public static testJNALibHelper INSTANCE = (testJNALibHelper) Native.loadLibrary("D:/MyPath/CPPDynamicLibToBeCalledViaJNA",

testJNALibHelper.class);

I'd recommend against hard-coding a path to your library. If you *do* use an absolute path, you need to use the full filename, including extension.

The following:

java.lang.System.setProperty("jna.library.path","D:/Mypath");

and the following:

NativeLibary.addSearchPath("CPPDynamicLibToBeCalledViaJNA","D:/ Mypath");

both do not compile.

typically you'd set jna.library.path on the command line when launching the VM, not in your code. If you're using an absolute path, jna.library.path is ignored.