I'm very new to JNI, and trying to write a HelloWorld program using the tutorial given here and on giving the command as
javah HelloWorld
or javah -classpath <classpath> HelloWorld
for different values
for eg. javah -classpath /home/my_myfolder -o HelloWorld.h example.jni.HelloWorld
but I am getting
error: cannot access HelloWorld
class file for HelloWorld not found
javadoc : error -Class HelloWorld not found
Error : No classes were specified on the command line.
I have already tried all the answers listed here but none have worked for me.
If you could be a little specific with what to specify as my classpath, I'd be grateful. Assume my code HelloWorld.java
is in /home/my_folder
, as is the HelloWorld.class
file.
UPDATE -- Okay, so the problem was solved, and it wasn't the classpath at all, but the example program given in the link that I used was itself faulty.
There is an extra HelloWorld obj = new HelloWorld();
required in the sample code., in the main()
function.