Configure JDK + eclipse + Android SDK in Linux

Source: Internet
Author: User


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

In the/etc/profile file, configure the SDK path export Path = $ java_home/bin: $ java_home/JRE/bin: $ path: $ home/bin: /home/AND/Java/Android-SDK-Linux/tools

Then, log out of the system and enter Android-H on the terminal to check the effect. If Android is an internal command, you can install it correctly. then proceed to the following steps:

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

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.