1、安装make build工具 执行以下命令: sudo apt-get install build-essential 2、下载NDK 官网下载页:http://developer.android.com/tools/sdk/ndk/index.html 下载下来后,解压缩 tar -xvf android-ndk-r9-linux-x86_64.tar.bz2 3 配置NDK环境参数 打开 ~/.bashrc文件: export NDK_HOME=/root/android-ndk-r9 export PATH=$PATH:$NDK_HOME $NDK_HOME ndk-build -v 4 .编译有两种方法 cd ~/android-ndk-r9/samples/hello-jni/jni ndk-build $NDK_HOME/ndk-build -C ~/android-ndk-r9/samples/hello-jni/jni 用 -C 指出工程目录路径 5 集成到eclipse 1)安装CDT CDT Juno - <a target=_blank href="http://download.eclipse.org/tools/cdt/releases/indigo" target="_blank">http://download.eclipse.org/tools/cdt/releases/indigo</a> 2)安装ndk ADT - https://dl-ssl.google.com/android/eclipse/
打开Eclipse,设置NDK路径,Window -> Preferences -> Android -> NDK
右键点击项目,Android Tools -> Add Native Support
右击项目,Debug As -> 3 Android Native Application