6

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

krsteeve
  • 1,794
  • 4
  • 19
  • 29
Sony
  • 7,136
  • 5
  • 45
  • 68

2 Answers2

27

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
Community
  • 1
  • 1
tgkprog
  • 4,493
  • 4
  • 41
  • 70
0

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.