javah error
Hi,
I'm trying out a sample JNI program but am unable to get the javah
tool to work. I have 1 source file, HelloWorld.java in C:\Work
\JNIHelloWorld. These are the contents of this file:
//File: Hello.java
class Hello {
public native void sayHello();
static {
System.loadLibrary("hello");
}
public static void main(String[] args) {
Hello h = new Hello();
h.sayHello ();
}
}
This is how I'm invoking javah.exe:
C:\Work\JNIHelloWorld>javah -classpath .;C:\Work\JNIHelloWorld -
verbose HelloWorld
error: cannot access HelloWorld
class file for HelloWorld not found
javadoc: error - Class HelloWorld not found.
[ Search Path: C:\Program Files\Java\jdk1.6.0_13\jre\lib
\resources.jar;C:\Program Files\Java\jdk1.6.0_13\jre\lib\rt.jar;C:
\Program Files\Java\jdk1.6.0_13\jre\lib\sunrsasign.jar;C:\Program Files
\Java\j
dk1.6.0_13\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_13\jre\lib
\jce.jar;C:\Program Files\Java\jdk1.6.0_13\jre\lib\charsets.jar;C:
\Program Files\Java\jdk1.6.0_13\jre\classes\.;C:\Work\JNIHelloWorld ]
Error: No classes were specified on the command line. Try -help.
I've also tried the call without the '.' preceding the classpath but
it results in the same error, and its always javadoc that throws the
error, not javah. What am I doing wrong?
Thanks in advance for your help,
Ashish.