• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to create Header file while using JNI technology

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic