Build an android SDK Development Environment on Ubuntu

Source: Internet
Author: User
Tags gz file android sdk manager
==== This article is the original site. You are welcome to reprint it! Reprinted please indicate the source: http://blog.csdn.net/yyplc====
Recording the android SDK this time is also the first time you have been in touch with the android SDK, and you have never done any android development. However, it indicates that there is no pressure and the entire process is still smooth.========================================================== ======================================Basic Environment:

System: Ubuntu 10.04 Linux WSN-laptop 2.6.38-12-generic #51 ~ Lucid1-Ubuntu SMP Thu Sep 29 19:55:22 UTC 2011 i686 GNU/Linux

Java: jdk1.7.0

Eclipse SDK: Version: 3.7.2 build ID: M20120208-0800

Android sdks: Android-15 (4.0.3)

========================================================== ======================

The procedure is as follows:

Step 1: Install the Java JDK

My download address is http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html

Select the JDK version based on your machine (32-bit or 64-bit) and system. The options are as follows:

Linux x86-compressed binary 92.17 MB Jdk-7-linux-i586.tar.gz

After the download, create a Java working folder in your workspace (/home/XXX ).

My options are:/home/WSN/Java, which is used to store JDK and eclipse SDK.

Copy the downloaded jdk-7-linux-i586.tar.gz file to/home/WSN/Java/and decompress the file.

To decompress the package, run the following command:

Tar xvf jdk-7-linux-i586.tar.gz

Then, a jdk1.7.0 directory is generated under the current directory, which contains the resources of the Java development platform.

Next, set the system environment variables:

Run sudo gedit/etc/environment to add the following content:

export JAVA_HOME=/home/wsn/java/jdk1.7.0export JRE_HOME=/home/wsn/java/jdk1.7.0/jreexport CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

Run sudo gedit/etc/profile to add the following content:

export JAVA_HOME=/home/wsn/java/jdk1.7.0export JRE_HOME=/home/wsn/java/jdk1.7.0/jreexport CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin

Use the command source/etc/profile or log out, and restart the system to make the environment variable take effect.

Next, let's test whether the JDK environment is set up, that is, compile a simple Java program to run the test:

Create a hello. Java file under/home/WSN/Java with the following content:

public class Hello{    public static void main(String args[]){        System.out.println("hello wrold");    }}

Run the following command to verify that JDK has been successfully created:

WSN @ WSN-LAPTOP :~ /Java $ javac hello. Java
WSN @ WSN-LAPTOP :~ /Java $ Java hello
Hello wrold
WSN @ WSN-LAPTOP :~ /Java $

In this way, enter the Java-version command on the terminal to view the following information:

WSN @ WSN-LAPTOP :~ /Java $ Java-version
Java version "1.7.0"
Java (TM) se Runtime Environment (build 1.7.0-b147)
Java hotspot (TM) server VM (build 21.0-b17, mixed mode)

The first step has been completed.

Step 2: Install the eclipse SDK

My download address is http://www.eclipse.org/downloads/

Select eclipse classic 3.7.2 Linux 32 bit

Eclipse
Classic 3.7.2, 173 MB
Downloaded
1,236,277 timesdetails other
Downloads

Linux
32 bit
Linux
64 bit

Then copy the compressed package to/home/WSN/Java and decompress it: Tar xvf eclipse-SDK-3.7.2-linux-gtk .tar.gz

After completion, generate the eclipse directory in the current directory, which contains an eclipse executable file, and double-click it. If it runs properly

You will see the eclipse SDK development environment. If the following error is prompted:

no java virtual machine wasfound after search the fllowing location
It means that the eclipse SDK cannot find the JDK. By default, it searches for the JDK under Eclipse/JRE. If it cannot find the JDK, this error will occur.
You can use a soft link on your resume to link files under jdk1.7.0/JRE/to/Eclipse/JRE.
wsn@wsn-laptop:~/java/eclipse$ ln -sf ../jdk1.7.0/jre/  jre
This solves the problem.
Step 3: Install ADT (Android development tools)
There can be two ways, one is to install online through the eclipse SDK, the other is to download the package and then install it with the eclipse SDK
I use the first method:
Open eclipse and click Help --> install new software as follows:
Address: https://dl-ssl.google.com/android/eclipse/
 
Click next:
 
Next, install:
 
After the installation is complete, the following two options will appear in the eclipse SDK menu windows:
Android SDK Manager
AVD
Step 4: Add platforms and other packages
In the eclipse SDK windows menu, click Android SDK manger to add your own Android version. I have added the latest version 4.0.3 as follows:
 
Step 5: add an AVD (Android Virtual Device) Analog Device
In the eclipse SDK windows menu, click New In the android AVD pop-up dialog box, and enter the desired simulated device parameters,
The parameter settings affect the performance of the simulated device. my options are as follows:
This completes the entire process of setting up the android SDK development environment for Ubuntu. First, let's take a look at the effect of the mysterious Android system ~, Actually, it's not that mysterious ~ :
The next section describes how to perform development and testing based on the created development environment.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.