• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to create Header file while using JNI technology

 
Saurabh Vyas
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I am new to JNI and i am learnig to develop applications using jni.
I am working on windows platform and want to call C++ classes from java.
I read the Java Native Interface tutorial on java.sun site and tried to implement the HelloWorld example given in it. I followed the instructions but in the 3rd step of creating the Header file i get the error "Class HelloWorld could not be found" whereas the fact is that the .class file is properly created and is in the same folder.
Also if i copy the already given file of tutorial and go to the next step ie.native method implementation than in compilation of .c file i get the error jni.h not found, whereas it is there in my java package, also my path is properly set.
Can anyone help me as to how do i proceed and run this HelloWorld application successfully
Though you may find , it a stupid question but please help me as i am just a beginner in jni field.
Thank you
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need the current directory, ".", in your classpath. If you are unfamiliar with the classpath, consult the Javaranch FAQ: How to set the Classpath
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!