KaiserJohaan KaiserJohaan - 1 year ago 108
Android Question

android - javah doesn't find my class

I am having troubles generating the C header file for JNI using


Here's the script I use while standing in the

javah -classpath C:\PROGRA~2\Android\android-sdk\platforms\android-8\android.jar com.test.JniTest

As return I get:

ERROR: Could not find class file for 'com.test.JniTest'.

Even though the class
certainly is in

What am I doing wrong?

Answer Source

You specify the classpath to contain only android.jar.

You also need to include the location where your classes are stored. In your case it is the current directory, so you need to use . (separated by ; on Windows). The invocation should look like this:

javah -classpath C:\PROGRA~2\Android\android-sdk\platforms\android-8\android.jar;. com.test.JniTest
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download