Address: http://www.cnblogs.com/nju-dwk/archive/2012/03/01/2376136.html
Reprinted for reasons: it is good, but it can be used directly.
1. Uninstall openjdk
Delete all packages containing openjdk from the New Software Center
2. Install sun jdk1.6
[1] From http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html
Download a jdk-6u31-linux-i586.bin File
[2] Move the jdk-6u31-linux-i586.bin file to the location where you want to install JDK, here to/usr/local/Java, of course you can also not move
$ MV jdk-6u31-linux-i586.bin/usr/local/Java
[3] Run the file
$ CD/usr/local/Java
$./Jdk-6u31-linux-i586.bin
[4] modifying Environment Variables
$ Sudo gedit/etc/profile
Add the following content at the end of the file:
Export java_home =/usr/local/Java/jdk1.6.0 _ 31
Export jre_home =/usr/local/Java/jdk1.6.0 _ 31/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ jre_home/bin: $ path
3. Install eclipse
[1] There are two ways to install Eclipse: Install it from the Ubuntu Software Center and download it manually. Here, you can manually download and install eclipse to the desired location.
Download the Eclipse IDE for Java example (eclipse-java-indigo-sr2-linux-gtk.tar.gz) file from http://www.eclipse.org/downloads. More
Eclipse versions, including eclipse classic, Eclipse IDE for Java developers, and Eclipse IDE for Java EE developers. Individuals
I don't think it needs to be too tangled. It should be okay, but it is recommended to install Eclipse IDE for Java developers on Android textbooks because it has already integrated several Android needs
.
[2] decompress the file eclipse-java-indigo-sr2-linux-gtk.tar.gz
$ Tar zxvf eclipse-java-indigo-SR2-linux-gtk.tar.gz
[3] Move the decompressed folder to the desired location.
[4] setting up eclipse shortcuts
$ Sudo gedit/usr/share/Applications
$ Sudo gedit eclipse. Desktop
Add the following content to eclipse. Desktop:
[Desktop entry]
Encoding = UTF-8
Name = eclipse platfrom
Comment = Eclipse IDE
Exec = your_eclipse_dir/eclipse
Icon = your_eclipse_dir/icon. XPM
Terminal = false
Startupnotify = true
Type = Application
Categories = application; development;
Grant permissions to files
$ Sudo chmod U + x eclipse. Desktop
Remove the spaces before and after each line. In this way, the eclipse shortcut appears in the System menu.
4. Install the android SDK
I have to say that the building process of the android environment is still very complicated, mainly because online installation is basically unrealistic in China, while offline installation requires downloading multiple components separately, and pay attention to the corresponding version issues. The original example here is that components that can be installed offline are not installed online. After yesterday's exploration, the main components required by the android environment are: Android SDK, SDK tools, platforms, platform tools, and ADT.
[1] first install the android SDK, which can be downloaded from http://developer.android.com/sdk/index.html. Download android-sdk_r16-linux.tgz here
[2] unzip the android-sdk_r16-linux.tgz
$ Tar zxvf android-sdk_r16-linux.tgz
[3] place the decompressed folder in the desired location.
5. Install SDK tools
In the current version, the SDK tools has been included in the android SDK, and its location is your_android_sdk_dir/tools.
6. install platforms, platform tools, and ADT offline.
The installation of these three components is the most time-consuming and troublesome. The Orthodox online installation method is to use the SDK manager in SDK tools to download and install them. However, in tianchao, this cannot be achieved. The offline installation method is as follows:
[1] Pay Attention to the version. Currently, the SDK tools and ADT versions must be the same. Because the downloaded Android SDK version is the latest 16, it contains the SDK Tools version that is 16. Therefore, the ADT version must download 16. In fact, except for platforms, the latest download of other components is the safest. To view the latest version of each component, the SDK Manager works now. After running the SDK, you can see the latest versions of platform tools and ADT. How to run SDK Manager:
$ CD your_android_sdk_dir/tools
$./Android
We can see that the latest platform Tools version is 10 and the ADT version is 16. OK. Download these packages offline.
[2] The preceding components are as follows:
Android SDK tools, revision 10 |
Http://dl-ssl.google.com/android/repository/tools_r10-windows.zip |
Android SDK platform-tools, Revision 3 |
Http://dl-ssl.google.com/android/repository/platform-tools_r03-windows.zip |
Android SDK docs for Android API 11, Revision 1 |
Http://dl-ssl.google.com/android/repository/docs-3.0_r01-linux.zip |
Android SDK Platform 3.0, Revision 1 |
Http://dl-ssl.google.com/android/repository/android-3.0_r01-linux.zip |
Android SDK platform 2.3.3. _ R1 Revision 1 |
Http://dl-ssl.google.com/android/repository/android-2.3.3_r01-linux.zip |
Android SDK platform 2.3.1 _ R2 Revision 2 (obsolete) |
Http://dl-ssl.google.com/android/repository/android-2.3.1_r02-linux.zip |
Android SDK platform 2.2 _ R1 Revision 2 |
Http://dl-ssl.google.com/android/repository/android-2.2_r02-windows.zip |
Android SDK platform 2.1 _ R2 Revision 2 |
Http://dl-ssl.google.com/android/repository/android-2.1_r02-windows.zip |
Android SDK platform 1.6 _ R2 Revision 3 |
Http://dl-ssl.google.com/android/repository/android-1.6_r03-windows.zip |
Android SDK platform 1.5 _ r3 Revision 4 |
Http://dl-ssl.google.com/android/repository/android-1.5_r04-windows.zip |
Android SDK samples for Android API 11, Revision 1 |
Http://dl-ssl.google.com/android/repository/samples-3.0_r01-linux.zip |
Android SDK samples for Android API 10, Revision 1 |
Http://dl-ssl.google.com/android/repository/samples-2.3.3_r01-linux.zip |
Android SDK samples for Android API 9, Revision 1 |
Http://dl-ssl.google.com/android/repository/samples-2.3_r01-linux.zip |
Android SDK samples for Android API 8, Revision 1 |
Http://dl-ssl.google.com/android/repository/samples-2.2_r01-linux.zip |
Android SDK samples for Android API 7, Revision 1 |
Http://dl-ssl.google.com/android/repository/samples-2.1_r01-linux.zip |
Android + Google APIs, API 11, Revision 1 |
Http://dl-ssl.google.com/android/repository/google_apis-11_r01.zip |
Android + Google APIs, API 10, Revision 1 |
Http://dl-ssl.google.com/android/repository/google_apis-10_r01.zip |
Android + Google APIs, API 9, revision 2 |
Http://dl-ssl.google.com/android/repository/google_apis-9_r02.zip |
Android + Google APIs, API 8, revision 2 |
Http://dl-ssl.google.com/android/repository/google_apis-8_r02.zip |
Android + Google APIs, API 7, Revision 1 |
Http://dl-ssl.google.com/android/repository/google_apis-7_r01.zip |
Android + Google APIs, API 4, revision 2 |
Http://dl-ssl.google.com/android/repository/google_apis-4_r02.zip |
Android + Google APIs, API 3, Revision 3 |
Http://dl-ssl.google.com/android/repository/google_apis-3-r03.zip |
Google USB driver package, Revision 4 |
Https://dl-ssl.google.com/android/repository/usb_driver_r04-windows.zip |
The URL here is for reference only, and only platforms and platform tools must be downloaded here. Others can be downloaded as needed. During download, you only need to change the version to the number you want, and change windows to Linux in Linux. The ADT is http://developer.android.com/sdk/eclipse-adt.html#downloading. the file name is ADT 16.0.1.zip (operating system is not differentiated ).
[3] decompress platform tools and place it in the previous SDK Directory, which is parallel to the Tools Folder.
[4] Download platforms Version 2.2, decompress it, and put it in the platforms folder under the SDK directory.
[5] Run eclipse and install ADT offline. Eclipse-> help-> install new software-> Add-> archive, find ADT 16.0.1.zip, and OK. Even this offline installation takes a long time, and some files are automatically downloaded from the official website during the installation process.
[6] Configuration
Eclipse-> window-> preferences-> Android, select the path of the android SDK, OK