通过javah可以自动生成相应的JNI的.h文件,运行“javah -help” 命令显示用法如下:

            
  1. Z:\>javah -help 
  2. Usage: javah [options]  
  3.  
  4. where [options] include: 
  5.  
  6.         -help                 Print this help message and exit 
  7.         -classpath      Path from which to load classes 
  8.         -bootclasspath  Path from which to load bootstrap classes 
  9.         -d               Output directory 
  10.         -o              Output file (only one of -d or -o may be used) 
  11.         -jni                  Generate JNI-style header file (default
  12.         -version              Print version information 
  13.         -verbose              Enable verbose output 
  14.         -force                Always write output files 
  15.  
  16.  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

更多相关文章

  1. Android之根据图片的Uri获取对应的路径
  2. mac配置android环境(android studio)
  3. Android实战教程第七篇之如何在内存中存储用户名和密码
  4. 关于android 获得 图片的方式
  5. Android基础 : Android(安卓)ContentProvider
  6. 制作android开机logo
  7. Android(安卓)Dialog的四种情况
  8. Android平台开发-WIFI function porting-WIFI功能移植
  9. Apache Ant 环境开发Android应用 二

随机推荐

  1. Android(安卓)Media Framework(1): 总纲
  2. Xamarin.Android(安卓)入门开发
  3. Mac 安装adb
  4. android sqlite中字符串含有单引号的处理
  5. android notepad详解
  6. android启动Activity的两种方法
  7. 安卓Android模拟器 SDK 2.2 2.3 下载与安
  8. android立体图形——三棱锥
  9. android解析JSON字符串
  10. Android(安卓)OpenGL ES 2.0 (七) Frameb