sparkFinder
sparkFinder

Reputation: 3394

Javah Not Recognizing class (A) mentioned in class (B) when operating on class B

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?

Upvotes: 1

Views: 455

Answers (1)

Paŭlo Ebermann
Paŭlo Ebermann

Reputation: 74790

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

Upvotes: 1

Related Questions