Document
Eclipse--windows--> Preferences ...
3. Set up Variables:
1. Path Variable ' cocos2dx ':
* eclipse->preferences->general->workspace->**linked resources**
* Click **new** button to add a Path Variable ' cocos2dx ' pointing to the root cocos2d-x directory.
! [Example] (https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png)
2. Environment Variable ' ndk_root ':
* eclipse->preferences->c/c++->build->**environment**.
* Click **add** button and Add a new variable ' ndk_root ' pointing to the ROOT NDK directory.
! [Example] (https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png)
* Only for Windows:add new variables **cygwin** with value ' nodosfilewarning ' and **shellopts** with value ' IGNCR '
4. Import LIBCOCOS2DX Library Project:
1. File->new->project->android Project from Existing Code.
2. Click **browse** button and open ' Cocos2d-x/cocos2dx/platform/android/java ' directory.
3. Click **finish** to add Project.
# # # Adding and running from Eclipse
! [Example] (https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/ COCOS2D-X-ECLIPSE-PROJECT-FROM-CODE.PNG)! [Import] (https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/ Cocos2d-x-eclipse-import-project.png)
1. File->new->project->android Project from Existing Code
2. **browse** to your project directory. Eg: ' Cocos2d-x/cocos2dx/samples/cpp/testcpp/proj.android/'
3. ADD the Project
4. Click **run** or **debug** to compile C + + followed by Java and to Run on connected device or emulator.