无论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:


在eclipse中配置android ndk的自动编译环境builders的更多相关文章

  1. 在eclipse里配置Android ndk环境 适用于windows mac 和linux(转)

    在eclipse里配置Android ndk环境 适用于windows mac 和linux(转) 2012-02-27 13:02:16|  分类: android |  标签:java  prog ...

  2. Ubuntu 14.04 x64配置Android 4.4 kitkat编译环境的方法

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

  3. Android开发:在Eclipse中配置Android环境

    一.文件需要: https://pan.baidu.com/s/1-XCSSPW5JGyPRlvwRVSfmA 提取码:m5t8 NDK过大没有上传在这个文件里. 二.在Eclipse中配置Tools ...

  4. eclipse里配置Android ndk环境,用eclipse编译.so文件

    做Android NDK开发时,c代码需要用ndk-build来进行编译,而java代码则需要用Android sdk编译. 编译c代码有两种方法: 一.写好c代码后,然后用cygwin搭建ndk-b ...

  5. 在Ubuntu14.4(32位)中配置I.MX6的QT编译环境

    1,开发工具下载 一,下载VMware Workstation虚拟机 地址:http://1.xp510.com:801/xp2011/VMware10.7z 二,下载Ubuntu 14.04.5 L ...

  6. Maven学习(一) -- 安装Maven及Eclipse中配置Maven

    标签(空格分隔): 学习笔记 本文环境:Windows7, JDK1.7.0_76 安装及配置Maven环境变量 需要电脑中已经有Java环境 在控制台中输入:echo %JAVA_HOME%看是否能 ...

  7. 在Eclipse中配置Tomcat 创建和运行Servlet/JSP

    在Eclipse中配置Tomcat 创建和运行Servlet/JSP 步骤一:在Eclipse中配置Tomcat(注意下载Eclipse IDE for Java EE Developers) (1) ...

  8. 【Java Web】Eclipse中配置Marven环境

    1  Marven简介 Apache Maven,是一个软件(特别是Java软件)项目管理及自动构建工具,由Apache软件基金会所提供.基于项目对象模型(缩写:POM)概念,Maven利用一个中央信 ...

  9. eclipse中配置spring环境

    初识Spring框架 1.简单使用 eclipse中配置Spring环境,如果是初学的话,只需要在eclipse中引入几个jar包就可以用了, 在普通java project项目目录下,建一个lib文 ...

随机推荐

  1. 为什么函数式编程可以没有while?

    以前想不通,今天在写代码时不知怎么的,偶然就发现了答案.. 比如说把某个字符串s中所有"00"及更长的'00'统统换为'0'.最后结果中不能包含'00'. 00001100--&g ...

  2. 树莓派初体验,安装Ubuntu 14.04 LTS

    转载自:http://www.polarxiong.com/archives/%E6%A0%91%E8%8E%93%E6%B4%BE%E5%88%9D%E4%BD%93%E9%AA%8C-%E5%AE ...

  3. windows平台下 c/c++进行http通信的教训

    由于需要使用c++开发一个桌面应用软件,需要用到http请求进行通讯,也是本人第一次进行网络相关的开发工作,遇到了不少坑. 由于是在windows下开发和使用的应用软件,自然而然想到了调用Window ...

  4. Mybatis源码分析之存储过程调用

    这一篇博客我们学习一下Mybatis调用存储过程的使用和运行流程.首先我们先创建一个简单的存储过程 DELIMITER $ CREATE PROCEDURE mybatis.ges_user_coun ...

  5. Android必知必会-使用okhttp的PUT方式上传文件

    注:如果移动端排版有问题,请看 简书版 (<-点击左边),希望CSDN能更好的支持移动端. 背景 公司的文件上传接口使用PUT协议,之前一直用的都是老项目中的上传类,现在项目中使用了okhttp ...

  6. struts1.x mvc简单例程

    因为项目需要,需要使用struts1.x .因此学习下struts框架. 例程从struts 实现MVC框架入手,完成一次request请求. 一.前台 两个jsp文件 index.jsp: 只有一个 ...

  7. Android 5.x 权限问题解决方法

    android 5.x开始,引入了非常严格的selinux权限管理机制,我们经常会遇到因为selinux权限问题造成的各种avc denied困扰.  本文结合具体案例,讲解如何根据log来快速解决9 ...

  8. 2、MyEclipse和Eclipse调优,MyEclipse配置(tomcat和jdk的内存设置),jar引入相关知识点,将Java项目编程web项目的办法

    1.WindowàPreferenceàGeneralàWorkspaceàText file encoding都改成UTF-8 2.WindowàPreferenceàGeneralàEdito ...

  9. 漫谈android系统(4)bring up panel

    点击打开链接 版权声明: 作者:alex wang 版权:本文版权归作者和CSDN共有 转载:欢迎转载,为了保存作者的创作热情,请按要求[转载],谢谢 要求:未经作者同意,必须保留此段声明:必须在文章 ...

  10. MMD4Mecanim介绍

    MMD4Mecanim是一位11区大神写的为Unity游戏引擎导入MMD模型的插件,目前依然在持续更新中. 需要Unity4.0以上版本.本教程使用Unity4.6.1(下载请自行百度) 插件君首页: ...