• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting "cannot access Hello" while running javah -jni Hello

 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am new to JNI
I am trying to make my first program.

I have made my Hello.java file as follows



I have successfully compiled it.

Now when I try to execute "javah -jni Hello" it is giving me a following error message

error: cannot access HelloWorld class file for Hello
not found javadoc: error - Class Hello not found.
Error: No classes were specified on the command line.
Try -help.


Help always appreciated.
Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Hello.class in a subdirectory called test/jni from the directory where you run this command?
 
Bhavesh Dak
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is Hello.class in a subdirectory called test/jni from the directory where you run this command?


Yes, I compiled Java file generated Hello.class file resides in the same subdirectory (test/jni).

That is why I wondered why it did not worked !

Is there any specific configuration do I need to provide to use "javah -jni" ?
Is there something to do with classpath?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must provide the classname, and that's test.jni.Hello, not Hello.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!