Android开发:javah的使用方法
16lz
2021-01-24
通过javah可以自动生成相应的JNI的.h文件,运行“javah -help” 命令显示用法如下:
- Z:\>javah -help
- Usage: javah [options]
- where [options] include:
- -help Print this help message and exit
- -classpath
Path from which to load classes - -bootclasspath
Path from which to load bootstrap classes - -d
Output directory - -o
Output file (only one of -d or -o may be used) - -jni Generate JNI-style header file (default)
- -version Print version information
- -verbose Enable verbose output
- -force Always write output files
are specified with their fully qualified names (for instance, java.lang.Object).
example: hello-jni应用程序所在目录为 F:\hello-jni, 编译生成的class文件在bin\classes文件夹下,那么调用javah时的classpath 必须指向该路径 第一种情况: F:\hello-jni>javah -classpath bin/classes com.example.hellojni.HelloJni 在应用程序根目录下,那么classpath 的相对路径为 bin/classes 第二种情况: F:\hello-jni\bin>javah -classpath classes com.example.hellojni.HelloJni 在bin目录下,那么classpath的相对路径为 classes 第三种情况: F:\hello-jni\bin\classes>javah -classpath . com.example.hellojni.HelloJni 在classes目录下,那么classpath应该为当前目录,即 . 第四种情况: F:\temp>javah -classpath F:\hello-jni\bin\classes com.example.hellojni.HelloJni 此时classpath 应该指向classes所在的绝对路径,即F:\hello-jni\bin\classes
更多相关文章
- Android之根据图片的Uri获取对应的路径
- mac配置android环境(android studio)
- Android实战教程第七篇之如何在内存中存储用户名和密码
- 关于android 获得 图片的方式
- Android基础 : Android(安卓)ContentProvider
- 制作android开机logo
- Android(安卓)Dialog的四种情况
- Android平台开发-WIFI function porting-WIFI功能移植
- Apache Ant 环境开发Android应用 二