[Z] ubuntu12.04 build an android Development Environment

Source: Internet
Author: User

I have been preparing to learn something about Linux and have never put it into practice. I have been preparing to install it this weekend. I have been doing Android development for nearly half a year, and I want to learn something about the framework and source code...

Before the installation, Baidu Google also read a lot of information on the Internet many times. To sum up, it is still unclear for entry-level people like me. In combination with the information on the Internet, I want to improve it here. I hope it will be helpful to people later, so I can also learn it.

First, install ubuntu. Here is a link to download Ubuntu from the official Ubuntu website http://www.ubuntu.org.cn/download/. I installed it on win7, And the Ubuntu version is 11.04. The two systems are downloaded in The. ISO file format and loaded with a virtual optical drive. You can double-click wubi.exe to install them, just like installing an application.ProgramThat's easy. The Ubuntu official website also provides detailed installation tutorials. We recommend that you install it in a blank partition during installation. You can use the system disk to manage it. If you do not understand it, leave a message for me. If necessary, I will improve it.

After the installation, there are prompts to update some things, such as language packs, because after the installation, it is a Chinese character, and the update will not be too much affected. Of course, if you have time, update the system first. It is not too late to install the system after everything is OK. It will not affect the system...

------------------------- Install JDK -------------------------

The next step is to install JDK. Please note that, because the system comes with openjdk, some prompts will be prompted when you enter the Java-version command in the terminal. Do not worry about this, there is no impact. We need to manually configure our own JDK. Okay, let's talk about this.

First to begin

After that, copy jdk-7-linux-i586.tar.gz to the/home/AND/Java/directory. For Beginners, you may not be able to understand the meaning of each command by using commands, and use graphical methods here. Right-click and choose archive manager to open the file. Then you can see all the content in the file. We need to decompress it,

Click "decompress" on the toolbar to decompress it to the current directory. The JDK directory is/home/AND/Java/jdk1.7.0, which is already decompressed, configure the environment variables.

Enter sudo gedit/etc/environment in the terminal and press Enter. A password is required, and a file is opened. Enter the following three lines in the file:

Export java_home =/home/AND/Java/jdk1.7.0

Export jre_home =/home/AND/Java/jdk1.7.0/JRE

Export classpath =.: $ classpath: $ java_home/lib: $ java_home/JRE/lib

Note that in the last row, the classpath is followed by a.: (I forgot to write a hello World, which can be compiled but cannot be run)

Similarly, modify the second file and enter sudo gedit/etc/profile in the terminal and press Enter.

Add the following four lines to this file:

Export java_home =/home/AND/Java/jdk1.7.0

Export jre_home =/home/AND/Java/jdk1.7.0/JRE

Export classpath =.: $ classpath: $ java_home/lib: $ java_home/JRE/lib

Export Path = $ java_home/bin: $ java_home/JRE/bin: $ path: $ home/bin

This step is OK. log out of the user and enter Java-version in the terminal,

If you see this, it indicates that the installation is successful. Don't worry. First, write an example to test it:

Create the file hello. Java in the/home/AND/directory. open the file and enter the following content:

PublicClassHello {PublicStaticVoidMain (string ARGs []) {system. Out. println ("Hello wrold");}}

Save and enter javac hello in the terminal. java (Note: The hello is created under the/home/AND/directory. java file. Otherwise, you must first go to the corresponding directory to run this command. You can first try the LS command in the terminal to list all files in the current directory)

If no prompt is displayed, the compilation is successful, and nihao is executed. Enter Java hello

If Hello world is output, the configuration is complete,

------------------------- Install eclipse -------------------------

Due to a problem with the Five-stroke input method, the time was delayed and the following will continue...

Http://www.eclipse.org/downloads/, select Linux 32bit (of course, if the system is 64-bit, download 64-bit)

The decompression method is the same as the JDK installation method above. The decompression path is/home/AND/Java/Eclipse/eclipse,

Double-click eclipse to start the eclipse program.

At this time, even if eclipse is installed, you can create a new project in it, such as the previous Hello World

------------------------- Install the android SDK -------------------------

Official http://developer.android.com/sdk/index.html

Select android-sdk_r12-linux_x86.tgz

After the download is complete, double-click it to open it. The decompression method is the same as the previous JDK decompression method.

The decompressed path is/home/AND/Java/Android/android-sdk-linux_x86

In this case, the SDK is equivalent to a software manager. If you want to develop Android, you must have at least one Android version. In this case, it is empty. then configure the ADT plug-in eclipse.

------------------------- Install ADT -------------------------- in eclipse ------------------------

The official website provides two installation methods, refer (I had been here for a long time. During the installation, I was always prompted about the lack of things and so on. The next day I was able to install it again, which is inexplicable, hope that the installation is successful at one time !)

Open eclipse ---> help ---> install new software

Click Add next to the input box after work.

Enter ADT plugin after name (you can name it as needed)

Enter the following information after location:HTTPS:// Dl-ssl.google.com/android/eclipse/

Click OK. As prompted, install eclipse step by step. You will be prompted to restart eclipse and Select Restart now. (The configuration method is the same as that in Windows) then the configuration is OK.

Then, click the android plug-in icon in eclipse (the premise is to configure the android SDK directory first), and then download the required Android version through the graphical interface, and then it's the same as on windows... After configuration, run it. I wish you all the best.

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.