无论linux还是mac在jni目录中直接运行  ndk-build 就可以生成 lib目录及所需要的 so文件; windows 装上lnx模拟器也是一样;
每次修改完 c++代码, 都要运行一下 ndk-build,然后在 eclipse中运行 java 程序;非常之麻烦;   之所以麻烦,归根于对强大的eclipse ide环境的不熟悉; 其实 eclipse可以配置 jni的自动编译选项; 及每次编译的时候 java 代码由 java编译器编译;  而 jni中的c++代码,则由 ndk-build来编译处理(其实里面也是g++在处理);
关于配置方法,极力推荐以下文章,不懂e文无所谓,看图片都明白了。。。
引用网址:http://mobilepearls.com/labs/ndk-builder-in-eclipse/

Setting up Automatic NDK Builds in Eclipse

When editing native JNI code in an Android project using the Android NDK you may configure Eclipse to automatically rebuild your project when editing native code, just as it does for java. The below steps shows how to perform the necessary configuration (note that this requires revision 4 or later of the NDK - previous revisions does not contain the necessary ndk-build binary):

Start by right clicking on your android project (named hello-neon in the below screenshots) with JNI resources, and select Properties. In the resulting dialog, choose the Builders entry in the list to the left and press the New... button:

A new dialog will open presenting a list of builder types. Select the Program type and press the OK button:

In the Main tab, fill in the following:

Name:
NDK Builder
Location:
/opt/android-ndk/ndk-build (or wherever your ndk-build binary is). You may use a variable as in ${system_property:user.home}/lib/android-ndk/ndk-build
Working Directory:
${workspace_loc:/hello-neon} (replace hello-neon with your project name. Press the Browse Workspace... button to select it graphically)

The result should look something like the below:

Now continue with the refresh tab. Make sure the two checkboxes Refresh resources upon completion. and Recursively include sub-folders are checked. Choose the Specific resources radio button and press the Specify Resources... button:

Since the ndk-build process will generate files in the lib folder, we want Eclipse to discover changes made there without having to refresh manually. So select the lib folder in the project (create one if necessary) and press the Finish button:

Now skip the Environment tab and go to the final Build Options tab. Make sure the Run the builder: During auto builds checkbox is checked.

Since the NDK build only needs to happen when editing files in the jni folder, check that folder and press the Finish button.

Now finally press OK in the builder configuration dialog - the new NDK builder should now be up and running. Try editing any file in the jnifolder and check that the Console view produces output from the build process:

转自 http://lockriver.blog.163.com/blog/static/48723224201143111491801/

在eclipse中配置android ndk的自动编译环境builders相关推荐

  1. linux+4.4+android,Ubuntu 14.04 x64配置Android 4.4 kitkat编译环境的方法

    Ubuntu 14.04 x64配置Android 4.4 kitkat编译环境的方法跟Ubuntu 12.04 - 13.10 以及jellybean编译环境配置没多大区别, 顺便记录下而已: 64 ...

  2. 在Eclipse中配置NDK自动编译环境builders

    对于NDK的编译,切换到目标目录下,运行ndk-build脚本即可. 对于使用Eclipse开发,我们希望EC能自动的编译我们的NDK,那么只需要为工程添加一个Builders即可. 对于Window ...

  3. 在eclipse里配置Android ndk环境 适用于windows mac 和linux[转]

    由于做Android在底层有库的时候需要交叉编译环境,c代码需要用ndk-build来进行编译,而java代码则需要用Android sdk编译.之前由于对eclipse ide不太熟悉,所以往往编译 ...

  4. Eclipse中配置apache(包括apache下载、环境配置,添加eclipse)

    一开始是项目出现错误: The superclass "javax.servlet.http.HttpServlet" was not found on the Java Buil ...

  5. Eclipse 中修改android的Default debug keystore 搬家、备份后启动Android PANIC :Could not open D:\java2\android\and

    @我的解决方法是: 原有的环境变量 android_sdk_home D:\android-sdks 改为: android_sdk_home D:\android-sdks\.android 参考的 ...

  6. Maven安装与配置(最实用!!!)eclipse中配置maven

    Maven安装与配置 一.需要准备的东西 JDK Eclipse(本章主要是在eclipse中进行配置maven) Maven程序包 二.下载与安装 1. 前往maven下载最新版的Maven程序: ...

  7. 在Eclipse中的Android项目里实现代码复用

    引言 开发时通常都会有多个项目间代码复用的需求,这时通常的做法是设置项目依赖,让一个项目引用另一个项目,比如在Visual Studio中这样就很容易实现. 而在Eclipse中的Android项目里 ...

  8. 【eclipse中配置java】

    在eclipse中配置jdk Window–>Preferences–>java–>installed JREs–>add–>Standard VM–>选择jdk安 ...

  9. eclipse php设置xdebug,eclipse 中配置php的 XDebug调试

    1. 打开 eclipse for php IDE,window->preference->PHP->Debug 2. 配置phpserver 3. 我的已经增加好了,默认的应该有l ...

最新文章

  1. 陆奇宣布卸任COO后首度露面,将担任李彦宏的个人顾问
  2. qt的输出中文,数字到表格
  3. AngularJS中的表达式
  4. 字节跳动社招面试记录,java异常处理关键字
  5. React中的state和props有什么区别?
  6. 深度学习 --- 受限玻尔兹曼机RBM(MCMC和Gibbs采样)
  7. Cinema 4D* 中令人惊叹的体积效果
  8. [转帖]内网安全克服五重阻碍 迎来春天
  9. android 编译,gradle
  10. php写幻灯片,JavaScript原生代码实现幻灯片
  11. LabView-之1: 串口驱动
  12. ERStudio使用细则
  13. Linux获取SCSI序列号命令,linux下获取scsi上的磁盘设备的序列号
  14. docker搭建文档管理服务器,Docker中文文档
  15. 关于人脸识别,Taylor Swift是认真的
  16. 机器人学: 建模 规划与控制(英文原版)_伦敦大学国王学院机器人学理学硕士研究生offer一枚...
  17. 解决黑群晖切换网络环境后无法访问的问题
  18. 关于RedisInsight 创建数据库时 connection time out 连接超时的问题
  19. 红酒类小程序APP开发源码交付
  20. 谷歌开放生成式AI Bard,百度文心一言《唐伯虎点秋香》出圈

热门文章

  1. mysql replication 协议_深入解析MySQL replication协议
  2. 什么是groupid和artifactId?
  3. sonarqube静态扫描代码环境搭建及使用(本地环境)
  4. python转go_如何看待将Python代码转换成Go代码并进一步编译的 Grumpy 项目?
  5. python开发效率高吗_提升python开发者工作效率的六个库,你知道几个?
  6. tomcat 配置方法
  7. 华为eNSP安装使用教程 故障解决
  8. 涨工资一般涨百分之多少_上证50etf期权涨一个点能赚多少钱?
  9. mysql 工具_MySQL压力测试工具,值得收藏
  10. linux和java_java内存和linux关系