Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

Here's the script I use while standing in the <project-dir>in directory:

javah -classpath C:PROGRA~2Androidandroid-sdkplatformsandroid-8android.jar com.test.JniTest

As return I get:

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

Even though the class JniTest certainly is in comest.

What am I doing wrong?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
280 views
Welcome To Ask or Share your Answers For Others

1 Answer

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~2Androidandroid-sdkplatformsandroid-8android.jar;. com.test.JniTest

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...