* 该文件来自 Android NDK Sample - HelloJni, 为了便于说明问题,我作了一些修改。
*/
package com.example.hellojni;
public class HelloJni
{
public native String stringFromJNI();
public native String unimplementedStringFromJNI();
static {
System.loadLibrary("hello-jni");
}
}
david@xmomx:hellojni$ ls
Hello.class Hello.h Hello.java HelloJni.class HelloJni.java
david@xmomx:hellojni$ javah -jni HelloJni
error: cannot access HelloJni
bad class file: ./HelloJni.class
class file contains wrong class: com.example.hellojni.HelloJni
Please remove or make sure it appears in the correct subdirectory of the classpath.
com.sun.tools.javac.util.Abort
at com.sun.tools.javac.comp.Check.completionError(Check.java:164)
at com.sun.tools.javadoc.DocEnv.loadClass(DocEnv.java:149)
at com.sun.tools.javadoc.RootDocImpl.<init>(RootDocImpl.java:77)
at com.sun.tools.javadoc.JavadocTool.getRootDocImpl(JavadocTool.java:159)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:330)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:66)
at com.sun.tools.javah.Main.main(Main.java:147)
javadoc: error - fatal error
2 errors
david@xmomx:src$ ls
com
david@xmomx:src$ javah -jni HelloJni
error: cannot access HelloJni
class file for HelloJni not found
javadoc: error - Class HelloJni not found.
Error: No classes were specified on the command line. Try -help.
javadoc: error - Illegal package name: "com/example/hellojni/HelloJni"
1 error