无论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. 手势监听GestureDetector 案例

    以下只做长按和甩出(用户按下朝某一方向甩动手指)案例 OnGestureListener可以查看到更多的手势事件 案例 package com.qf.mobliesafe.activity; impo ...

  2. java 里面保留字volatile及其与synchronized的区别

           锁提供了两种主要特性:互斥(mutual exclusion) 和可见性(visibility).互斥即一次只允许一个线程持有某个特定的锁,因此可使用该特性实现对共享数据的协调访问协议, ...

  3. Android系统对话框

    Android系统对话框 效果图 2个按钮的对话框 3个按钮的对话框 自定义View的对话框 单选对话框 多选对话框 列表框 Code XML <?xml version="1.0&q ...

  4. 细说Http协议

    什么Http协议 HTTP是HyperText Transfer Protocol(超文本传输协议)的简写,它是TCP/IP协议的一个应用层协议,用于定义WEB浏览器与WEB服务器之间交换数据的过程及 ...

  5. ViewPager实现滑屏切换页面及动画效果(仿优酷客户端)

     找了许多实现该功能的例子,但效果都不很理想,于是自己结合网上的资源及自己的总结,整理了一下,发出来,供大家参考.这个是自己做的,仿优酷客户端的. 先看效果: ****************** ...

  6. WmS详解(一)之token到底是什么?基于Android7.0源码

    做Android有些年头了,Framework层三大核心View系统,WmS.AmS最近在研究中,这三大块,每一块都够写一个小册子来介绍,其中View系统的介绍,我之前有一个系列的博客(不过由于时间原 ...

  7. 详解EBS接口开发之供应商导入(补充)--错误信息处理

    check reject details on records of AP_SUPPLIER_INT SELECT s.parent_table,s.reject_lookup_code,S.LAST ...

  8. RxJava(八)concat符操作处理多数据源

    欢迎转载,转载请标明出处: http://blog.csdn.net/johnny901114/article/details/51568562 本文出自:[余志强的博客] 一.concat操作符概述 ...

  9. 单幅图像的深度学习,对NYU数据集进行划分

    针对分割问题,官方已经划分好了:http://cs.nyu.edu/~silberman/projects/indoor_scene_seg_sup.html import numpy as np i ...

  10. 【一天一道LeetCode】#263. Ugly Number

    一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Write a ...