[GRASS-windows] Call dll from java

Lalita Kadam lalita.k at iworktech.com
Wed Jul 15 09:50:11 EDT 2009


I am trying to use and evaluate the Jinvoke . I did all samples . it works
well . But when I started with your
Calling C/C++ DLLs from Java example
Java Code is as follows :

*

import* com.jinvoke.JInvoke;

*import* com.jinvoke.CallingConvention;

*import* com.jinvoke.NativeImport;

*public* *class* create {

@NativeImport(library=
"C:\\msys\\1.0\\local\\src\\grass-6.3.0\\vector\\v.dllcreate\\v.dllcreate.dll"
,convention=CallingConvention.*CDECL*)

*public* *static* *native* *void* funcGUIforCSVcreator(*int* num, String
name);

*public* *static* *void* main(String[] args) {

JInvoke.*initialize*();

*funcGUIforCSVcreator*(1,"Dll created for test");

}

}

It got compiled, on running I am getting follwing error :

J/Invoke: LICENSED FOR EVALUATION USE ONLY.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
native library
C:\msys\1.0\local\src\grass-6.3.0\vector\v.dllcreate\v.dllcreate.dll.

Ensure that

1) it exists in the java.library.path, or

2) specify it's full, correct path on the file system, and

3) ensure that it's dependencies are present in java.library.path

at com.jinvoke.JInvoke.InitMethod(*Native Method*)

at com.jinvoke.JInvoke.initialize(*JInvoke.java:146*)

at create.main(*create.java:12*)



Can you assist me in rectifying the error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-windows/attachments/20090715/055d0415/attachment.html


More information about the grass-windows mailing list