trouble with JNI

M

Mark

I'm using the IDEA IDE, but would like to understand how to do this from
the command-line at the least.

I'm running the simple HelloNative JNI example from Core Java vol II. It's
a simple C-method that just does a printf and is called from Java.

This is on Windows XP. I've made the dll for the C-routine and compiled the
java, etc....

The runtime exception is:
java.lang.UnsatisfiedLinkError: no jnitest1.dll in java.library.path

Even though I've put the path to the dll in the -classpath argument when I
run this test.

Any suggestions would be most appreciated.

Thanks in advance,
Mark
 
G

Gordon Beaton

The runtime exception is:
java.lang.UnsatisfiedLinkError: no jnitest1.dll in java.library.path

Even though I've put the path to the dll in the -classpath argument
when I run this test.

Put the dll in your path, not your classpath.

/gordon
 
J

james d.

Also, you may want to try using System.load() instead of
System.loadLibrary(). System.load allows you to specify the absolute path
of your .dll
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top