Configure jdk + eclipse + android sdk in ubuntu

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. 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:

public class Hello{
public static void 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,

------------------------- 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,

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: https://dl-ssl.google.com/android/eclipse/ after Location

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.

Leave me a message if you have any questions.

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.