Setting up Automatic NDK Builds in Eclipse

  次阅读 作者:智能小宝 来源:互联网 2016-01-14 13:10 我要评论(0)

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:


NDK Builder


/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 jni folder and check that the Console view produces output from the build process:


  • 未来两年人工智能要怎么走?看这篇就够了


  • 英国研发“杀生”机器人 通过生命体获取能量

    英国研发“杀生”机器人 通过生命体获取能量

  • 韩春雨称已能重复实验结果 近期将有消息公布

    韩春雨称已能重复实验结果 近期将有消息公布

  • 无人驾驶汽车如何改变城市生活?听听他们怎么说




霍金 视觉中国 图 英国著名物理学家霍金(Stephen Hawking)再次就人工智能(AI)发声,他认为:对于人类来说,强大AI的出现可能是最美妙的...

文|郑娟娟 今年,人工智能(AI) 60岁了。在AI60岁的时候,笔者想要介绍一下AI100,一个刚刚2岁的研究项目,但它的预设寿命是100年,甚至更长...

AlphaGo与李世石的人机大战,为大众迅速普及了人工智能的概念。 但对谷歌而言,除了下围棋,现在的人工智能进展到哪一步了?未来,人工智能...