J
johnmmcparland
Hi all,
I am learning to use JNI by following the walkthrough contained here;
http://java.sun.com/docs/books/jni/html/jniTOC.html
The only difference is that I call the files Hello instead of
HelloWorld.
I have managed to compile both Hello.java and compile Hello.c into the
library Hello.dll using this command;
gcc -mno-cygwin -I"${JAVA_PATH}/include" -I"${JAVA_PATH}/include/
win32" -W1,--add-stdcall-alias -shared -o Hello.dll Hello.c
where JAVA_PATH is the path to the java directory as cygwin sees it.
However I get an UnsatisfiedLinkError when I try to run the program;
$> java Hello
Exception in thread "main" java.lang.UnsatisfiedLinkError:
Hello.print()V
at Hello.print(Native Method)
at Hello.main(Hello.java:25)
I am suspicious of the "V" at the end of the Hello.print() line of the
exception message.
Does anyone have an idea why this is happening?
John
I am learning to use JNI by following the walkthrough contained here;
http://java.sun.com/docs/books/jni/html/jniTOC.html
The only difference is that I call the files Hello instead of
HelloWorld.
I have managed to compile both Hello.java and compile Hello.c into the
library Hello.dll using this command;
gcc -mno-cygwin -I"${JAVA_PATH}/include" -I"${JAVA_PATH}/include/
win32" -W1,--add-stdcall-alias -shared -o Hello.dll Hello.c
where JAVA_PATH is the path to the java directory as cygwin sees it.
However I get an UnsatisfiedLinkError when I try to run the program;
$> java Hello
Exception in thread "main" java.lang.UnsatisfiedLinkError:
Hello.print()V
at Hello.print(Native Method)
at Hello.main(Hello.java:25)
I am suspicious of the "V" at the end of the Hello.print() line of the
exception message.
Does anyone have an idea why this is happening?
John