I have been working in ubuntu for a while. I would like to summarize the establishment of the android development/compilation environment.
JDK installation:
Automatic Installation: ubuntu source provides a JDK which is a sun-java6-jdk that can be installed with Synaptic Package Manager (new), of course, you can also execute the following command in shell to install
Runner @ runner-Lenovo :~ $ Sudo apt-get install sun-java6-jdk
Manual installation:
Go to the official website to download the latest linux version of JDK, I download is jdk-6u26-linux-x64.bin. The/usr directory is mainly used to store some software used in the ubuntu system./usr/lib/jvm/is the default JDK directory of the system, so I plan to install the jdk I downloaded to this directory. /Usr/lib/jvm/create a new file, copy the jdk-6u26-linux-x64.bin to the folder, and then execute the following command
Sudo chmod u + x/usr/lib/jvm/java/jdk-6u26-linux-x64.bin modify binfile permissions to make them executable and then execute
Sudo./jdk-6u26-linux-x64.bin Installation
After the installation is complete, a jdk1.6.0 _ 26 folder is generated under/usr/lib/jvm/java. JDK installation is complete. Configure the environment variables as follows:
Command:
Sudo vi/etc/environment
PATH = "......:/usr/lib/jvm/java/jdk1.6.0 _ 26/bin" (there are quotation marks in this place. Neither classpath nor java_home is quotation marks)
CLASSPATH =.:/usr/lib/jvm/java/jdk1.6.0 _ 26/lib
JAVA_HOME =/usr/lib/jvm/java/jdk1.6.0 _ 26
Source/home/username/. bashrc (The sudo command cannot be run before the source command, because the source command does not belong to the system command)
The environment variable is set successfully.
Ubuntu has the default jdk-openjdk. Therefore, we need to perform the following work to make the jdk installed by default.
Run:
Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/java/jdk1.6.0 _ 26/bin/java 300
Format: sudo update-alternatives -- install/usr/bin/java: jdk bin directory/java 300
Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/java/jdk1.6.0 _ 26/bin/javac 300
Same format as above
In this step, add the installed jdk to the java menu.
Then execute:
Sudo update-alternatives -- config java
In this step, select the default jdk
In this way, enter the following in shell:
When java-version is used, it indicates that the system uses sun's java. So far, jdk is successfully installed and environment variables are successfully set.
2. go to the official website to download the latest eclipse, and decompress it to use it. But to download the corresponding eclipse, the 64-bit system will use the 64-bit eclipse, and the 32-bit system will download the 32, I forgot this problem when I first installed 64-bit ubuntu. I copied an eclipse from my friend, but I didn't succeed for a long time. Later I figured out that eclipse was a 32-bit
3. Configure ADT. Now there are a lot of articles on windows development environment on the Internet. For more information, see the official website: http://developer.android.com/sdk/eclipse-adt.htmlthe latest ADT is directed to ADT 12.0.0 (July 2011)
4. Configure the SDK. Then update. The update requires an event and wait patiently. Finally, configure the SDK in Eclipse, window ----> preferences> Android
Android compilation requires the following tools:
Sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g ++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev libxml-simple-perl