Build the Android development environment under 64-bit Ubuntu11.10 (JDK + Eclipse + ADT + AndroidSDK details)

Source: Internet
Author: User
Tags android sdk manager
Android development has been carried out in Windows, but sometimes the execution efficiency of Eclipse and simulators is not very high, and sometimes it is even unbearable. Therefore, Android development is implemented in Ubuntu, the following is the process of setting up the Android development environment and setting up the platform successfully. During the process of building the platform, I also gave a brief introduction to some precautions. The following is the text. 1. Install jdk1. download jdk. Here the 64-bit jdk6 is downloaded without jdk 7. If it is said on the Internet that the compatibility may be poor

Android development has been carried out in Windows, but sometimes the execution efficiency of Eclipse and simulators is not very high, and sometimes it is even unbearable. Therefore, Android development is implemented in Ubuntu, the following is the process of setting up the Android development environment and setting up the platform successfully. During the process of building the platform, I also gave a brief introduction to some precautions. The following is the text.

1. Install jdk

1. download jdk. Here we download the 64-bit jdk 6 without jdk 7. If it is said on the Internet that the compatibility may be poor, there is no risk. However, I installed jdk 7 on 64-bit Windows 7, normal use, here is the Linux x64 jdk-6u31-linux-x64.bin, You can also download the RPM self-extract format (that is, the file name with rpm ),:

Http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html

2. After the download is complete, prepare for installation. This is installed in the/usr/lib jvm directory. This is based on the online tutorial, And the jvm folder name is whatever you like. First, create the jvm directory under the/usr/lib directory:

$ Sudo mkdir/usr/lib/jvm

Then copy the file to the jvm directory under the jdk-6u31-linux-x64.bin directory:

$ Sudo cp jdk-6u31-linux-x64.bin/usr/lib/jvm

Then modify the access permission to start installation:

$ Sudo chmod + x jdk-6u31-linux-x64.bin

$ Sudo./jdk-6u31-linux-x64.bin

After the installation is successful, you can delete the/usr/lib/jvm/jdk-6u31-linux-x64.bin:

$ Sudo rm jdk-6u31-linux-x64.bin.

Note: The following will be the focus, key points, and difficulties of this tutorial. All the successes and failures are here.

3. Environment Variable Configuration:

Run the following command to open the/etc/environment file:

$ Sudo gedit/etc/environment, and modify it as follows. Note the path name:

JAVA_HOME = "/usr/lib/jvm/jdk1.6.0 _ 31"

PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/lib/jvm/jdk1.6.0 _ 31/bin"

CLASSPATH = "/usr/lib/jvm/jdk1.6.0 _ 31/lib"

PATH is used to specify the command search PATH. Because we need to use the command in the jdk/bin directory, we need to add this PATH to the environment variable PATH; CLASSPATH is used to specify the Class search PATH; JAVA_HOME points to the jdk installation directory. By setting JAVA_HOME, you do not need to configure java in Eclipse.

For details about this part, see: http://www.linuxidc.com/Linux/2012-03/56915.htm

Run the following command to check the path name:

$ Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.6.0 _ 31/bin/java 300

$ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.6.0 _ 31/bin/javac 300

Then we can check whether java is successfully installed.

$ Java-version

If the following content is displayed, the installation is successful:

Java version "1.6.0 _ 31"

Java (TM) SE Runtime Environment (build 1.6.0 _ 31-b04)

Java HotSpot (TM) 64-Bit Server VM (build ipv6-b01, mixed mode)

Ii. Install Eclipse

1. Download Eclipse to the official website: http://www.eclipse.org/downloads/. I downloaded 64-bit Eclipse IDE for Java EE Developers.

2. after the download is complete, extract to the directory you want to decompress, specifically by copying the downloaded content to the specified directory, and then decompress: tar-zxvf eclipse-jee-indigo-SR2-linux-gtk-x86_64.tar.gz, after decompression, the eclipse folder will appear. Here, change the file permissions in eclipse: $ sudo chmod 777 eclipse-R (777 and-R indicate changing the permissions of all files in the directory to readable and executable by anyone ).

For more information about this section, see: http://www.linuxidc.com/Linux/2013-06/85303p2.htm

3. Download the ADT plug-in

1. After installing Eclipse, start Eclipse and select Help> Install New Software

2. Click Add in the upper right corner.

3. After completing the above, a dialog box will pop up, fill in "ADT Plunin" in the name column, and then in the following column: https://dl-ssl.google.com/android/eclipse/

4. Click OK.

5. Select Developer tools and click Next.

6. Relay Next in the new window

7. Click Finish.

8. After the installation is complete, the system will prompt you to restart and choose restart.

See http://developer.android.com/sdk/eclipse-adt.html#installing for details

4. Download the android sdk

1. Open http://developer.android.com/sdk/index.html and download android-sdk_r16-linux.tgz

2. after the download is complete, find the downloaded file and decompress it to the directory you want to decompress. You can also copy the downloaded file to the specified directory and decompress it to the current directory: sudo tar-zxvf android-sdk_r16-linux.tgz, after decompression, a folder named android-sdk-linux will appear, then you may need to modify file permissions: $ sudo chmod 777 android-sdk-linux-R (where-R indicates that the permission for all files under the android-sdk-linux directory is changed to readable and executable by anyone ).

3. Start Eclipse, select window> preferences, click android on the left, select the SDK location (android-sdk-linux) In Browse on the right, and click OK.

4. Click Window> Android SDK Manager, select the desired android platform version, click Install, and then wait until the installation is complete.

5. Create an AVD, which may cause problems. The system may prompt "Failed to create the SD card. "and" Failed to create sdcard in the AVD folder. if this happens on a 64-bit machine, it may be because you do not have a ia32-libs that supports 32-bit software installed. In this case, enter the $ sudo apt-get install ia32-libs on the command line. After the operation is successful, you can create an AVD.

If this is not the reason, it may be the permission issue.

Specific reference: http://www.linuxidc.com/Linux/2012-10/73140.htm

Another point is to configure the android environment variables. You can add the tools and platform-tools paths to the PATH by referring to the java environment variable configuration, then restart the system.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

For more information about Android, see Android topics page http://www.linuxidc.com/topicnews.aspx? Tid = 11

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.