[Written in front of zero]
The order of Environment setup is as follows:1. JDK & JRE will install JRE along with JDK. This step aims to write and allow common Java programs2. Eclipse Java IDE, this step is to facilitate the development of Java programs3. CDT is a plug-in of eclipse. This step aims to introduce C ++4. ADT is a plug-in of eclipse. This step aims to manage the android development library.5. The previous step of adk is a tool. This step is the development library. At this step, you can compile a common android program.6. If a single ndk has a CDT, it can only be edited but cannot be compiled. This step aims to compile the C ++ program and then use it in Android.Here we do not need to use cygwin. We use the new ndk version to compile C ++.[JDK installation]1. The latest JDK version is 1.7. [important] You need to download JDK 1.6 here. Because the compilation of JDK 1.7 may fail, you have to run it back to 1.6jre. To avoid the trouble of setting it, download JDK 1.6 directly.
: Http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html select the corresponding system to start download Installation
2. You can use the JDK environment for Java development only by configuring a series of environment variables. The configuration environment variables include java_home, path, and classpath.
3. Right-click my computer ", choose "properties"> "advanced"> "environment variables"> "system variables"> "new" variable name, and write "java_home" in the input box ", write "C: \ Program Files \ Java \ jdk1.6.0" in the "variable value" input box"
4. Configure "classpath. Select "system variables" to check whether the classpath project exists. If not, click "new". If yes, select the classpath option and click "edit, enter "classpath" in "variable name" and "C: \ Program Files \ Java \ jdk1.6.0 \ JRE \ Lib" in "variable value"
5. Configure "path". Enter "C: \ Program Files \ Java \ jdk1.6.0 \ bin" in the "variable value" input box"
6. JDK environment variables have been configured. You can open the Command Prompt window and enter the command "Java-version" to see the Java version information to determine whether the installation is successful. Click Start, and then click Run ".
All JDK version information is displayed. On the other hand, JDK has been installed and configured. You can start Java development.
2. Install eclipse]
Eclipse can be used directly after decompression.
I downloaded the latest
[3. Install CDT]
Http://www.eclipse.org/cdt/downloads.php
Select the corresponding eclipse version for CDT download
4. Install ADT]There are two installation methods: Online installation, download installation, and network speed. I prefer to download and install.
[5. Install adk]
After installing ADT, restart eclipse and you will be prompted to install adk. You can specify the path or download and install
You can download the adk http://developer.android.com/sdk/index.html at this address
If the system is win7 64-bit, it must be opened as an administrator. Otherwise, an error will be prompted.If the download list is not displayed when you open SDK manager to download the SDK Open the hosts file: In the c: \ windows \ system32 \ drivers \ etc directory, the Linux user opens the/etc/hosts file.
[I am windows and tested]
Add the asterisk line code to the end of the file by default:
****************************************
# Google Homepage
203.208.46.146 www.google.com
# This line is used to enable the official Android development website. Now it seems that you can enable it without using VPN.
74.125.113.121 2.16.android.com
# Download the updated content from the following address:
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
****************************************
6. Install ndk]So far, we can use eclipse to write Android programs, but our goal is to write cocos2d_x in C ++. To achieve this, we need to take the last step -- ndkNdk is used for two purposes. The first is to compile our c ++ code into a link library. The link library here is the so or a file in Linux, different from the Windows DLLThe second objective is JNI. Java needs to call our c ++ code through JNI.
Decompress the package after the download.