在开发jni时,以前总是用cygwin来编译动态库,感觉好麻烦。百度了一下,在eclipse中也可以集成NDK编译动态库。下面两张是我配置好的图:
JAVA_H
Location:C:\Program Files\Java\jdk1.6.0_21\bin\javah.exe
Working Directory:${project_loc}
Arguments:-classpath ${project_loc}\bin\classes -d ${project_loc}\jni -jni ${java_type_name}
NDK:
Location:D:\android-ndk-r9\ndk-build.cmd
Working Directory: ${project_loc}
运行JAVA_H时要先选中所需要生成.h文件的jni 函数的java类
运行NDK时要先选中工程项目。