无论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. iOS学习笔记--数据存储

    iOS应用数据存储的常用方式 XML属性列表(plist)归档 Preference(偏好设置) NSKeyedArchiver归档(NSCoding) SQLite3 Core Data 1. XM ...

  2. premake设置静态运行库

    premake设置静态运行库(金庆的专栏)链接protobuf库时,碰到RuntimeLibrary不匹配:1>libprotobufd.lib(int128.obj) : error LNK2 ...

  3. Linux 高性能服务器编程——I/O复用的高级应用

    高级应用一:非阻塞connect connect系统调用的man手册中有如下的一段内容: EINPROGRESS The socket is non-blocking and the connecti ...

  4. ORACLE时间日期格式使用总结(参考网上资料汇总)

    Oracle时间日期操作 sysdate+(5/24/60/60) 在系统时间基础上延迟5秒 sysdate+5/24/60 在系统时间基础上延迟5分钟 sysdate+5/24 在系统时间基础上延迟 ...

  5. Html书写规范,基本标签使用

    一.html简介1.html是什么Html是用来描述网页的一种语言.(1)HTML 指的是超文本标记语言 (Hyper Text Markup Language)(2)HTML 不是一种编程语言,而是 ...

  6. Android中ViewFlipper的使用详解

    说到android的左右滑动效果我们可以说是在每个应用上面都可以看到这样的效果,不管是微博,还是QQ等. 实现左右滑动的方式很多,有ViewPager(不过这个和需要android-support-v ...

  7. App引导界面,可以这么玩

    什么是ViewPager,刚一听到这个词,我们可能感觉很奇怪,但是我相信我们大部分人都曾见到过这些界面的.其实它就是我们在安装好一个app之后第一次使用时的那些引导界面的效果.这就是通过ViewPag ...

  8. 理解WebKit和Chromium: Chromium WebView和Chrome浏览器渲染机制

    转载请注明原文地址:http://blog.csdn.net/milado_nju ## 数据对比 前面介绍过Chromium WebView的时候,说过有关ChromiumWebView同Chrom ...

  9. AsyncTask(异步任务)讲解-android的学习之旅(四十六)

    AsyncTask简介 Android的UI线程主要处理用户的按键,触屏和View的绘制等,不能在里面处理耗时的操作,否则会出现ANR,因此耗时的操作要单独开一个线程处理,但是新线程不能直接处理UI线 ...

  10. Git Bash+EGit在项目中配合使用最常用方法总结(根据场景使用)

    最近在项目中使用Git进行代码管理,之前一直用SVN进行管理,现在谈一谈Git在项目中如何与EGit插件配合使用,高效同步开发. 使用过SVN一段时间的人,初识Git一定感觉很别扭,发现会遇到各种各样 ...