Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jni help

 
prem marimuthu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
May i know how to create c header file using java jni for a class which is inside a jar file.
I have created a jar called HelloWorld.jar (using Netbeans) which has only class file as below


i tried following command

javah -jni HelloWorld
i am getting below error
error: cannot access HelloWorld
class file for HelloWorld not found

javah -jni example.HelloWorld
i am getting below error
error: cannot access HelloWorld
class file for HelloWorld not found

Please let me know how to create the c header file.

Regards,
Prem
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That class file (or the jar file that contains it) don't seem to be in the classpath when you run the "javah" command.
 
prem marimuthu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Ulf Dittmer Thanks for your reply. May i know how to give classpath in javah command. I kindly request the syntax for giving classpath in javah command.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typing "javah" on the command line will print out all its options, including how to give the classpath. The JNI tutorial on oracle.com is sure to cover that as well, as, in fact, should any JNI tutorial.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic