Over the past few days, I want to write android software on ubuntu. So I went online to find some information and set up the android environment on ubuntu. The results were either incomplete or outdated. So I wrote down the process of setting up the android environment so that I forgot to refer to it later. I also hope to give readers some inspiration for this blog.
There are several steps to build an android environment:
1. You must install java.
Download link java
Select the latest version and decompress jdk to the folder you want to put. my options are/var/android/java.
Then configure the environment variable:
Sudo gedit/etc/profile, which is added at the end of the profile file
Export JAVA_HOME =/var/android/java
Export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
The red part is what you need to modify.
Then restart the system and enter java and javac on the terminal to test whether the system is successful.
2. Install Eclipse
: Http://www.eclipse.org/downloads/
You don't have to worry about unzipping other files.
I decompress the package to/var/android/jeclipse.
Better Management
3. Configure ADT
Start Eclipse, and choose Help> Install New Software... -> Select Available Software on the tab,
Click "Add..." on the right. The dialog box is displayed. The settings are as follows:
Name: adt (optional)
Location: http://dl-ssl.google.com/android/eclipse/
Click "OK" to return, click "Select All", and then click "Next>" twice ".
You can also download and install existing files from the Internet.
4. Set the SDK path
After Eclipse is restarted, select Window> Preferences.... In the displayed properties box, select Android, enter the directory of your Android SDK In SDK location, and then click Apply.
Download link: Click the open link
Update after download
After the download is complete, decompress the package, go to the SDK root directory on the terminal, and then execute: tools/android update sdk-u
You can start the same update as in windows.
The android1.0-4.2 in the SDK platform are all clicked to open the link. Tianchao may not be able to download it. I tried to download it.