1

I'm trying to get a jni header for class B, and class A sits in the same package, right next to it.

Class B contains native functions (for which I need the JNI Header)

and I use the command

javah -jni ClassB -classpath (path to jarfile containing all the classes necessary, including classA) 

and I get the response

"Couldn't find class w.x.y.z.ClassA"

Where w.x.y.z is the right package path for classA and classB.

Any suggestions?

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
sparkFinder
  • 3,336
  • 10
  • 42
  • 57

1 Answers1

1

Try putting the options first, and only at the end the ClassB argument.

Also, the classpath should point to the root of the package hierarchy, not to the package directory. Then call it like this:

javah -jni -classpath library.jar w.x.y.z.ClassB
Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210