Reputation: 7186
When I tried to use javah to generate header files, I get this error:
Error: Could not find class file for 'HelloWorld'.
Here is my External tools configuration.
Location: ${system_path:javah}
Working Directory: ${workspace_loc:/JniJava/bin/sonyraj}
Arguments: -jni HelloWorld
Upvotes: 6
Views: 16843
Reputation: 1
I also had the same problem, try to put your .class files in a folder with the same name as the package name. Then run "javah packagename.ClassName". Hope it works for you too.
Upvotes: 0
Reputation: 4598
Try from the commnnd line/ terminal. maybe javah needs the full path to it? And without packages.
Or fully qualified package name as noted here Javah error while using it in JNI
javah -jni com.example.JavaHowTo
where com.example
is your package.
You also need to run javah from the directory containing com/example/JavaHowTo.class
e.g. if your structure is
/home/user/project/Iot/com/example/JavaHotTo.class
run javah from
/home/user/project/Iot
Upvotes: 27