Call dll from java

2 messages Options
Embed this post
Permalink
Lalita Kadam

Call dll from java

Reply Threaded More More options
Print post
Permalink
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


_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
Markus Neteler

Re: Call dll from java

Reply Threaded More More options
Print post
Permalink
Please consider to use GRASS 6.4 for this since its Windows
portability was significantly improved.

Download here:
http://grass.osgeo.org/grass64/binary/mswindows/

Markus


On Wed, Jul 15, 2009 at 3:50 PM, Lalita Kadam<[hidden email]> wrote:

> 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
>
> _______________________________________________
> grass-windows mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-windows
>
>
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows