Detailed Image Description for setting up an Android development environment under Ubuntu12.04

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.

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. the ubuntu official website is http://www.ubuntu.org.cn/download/with a chain download. the Ubuntu website is installed on win7's, And the ubuntu website is 11.04. The downloaded file is a. isofile format. With Virtual optical drive, wubi.exe can be installed, just as simple as installing an ordinary application. 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:

publicclass Hello{    publicstaticvoid main(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,

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.