Reinstall the Ubuntu system tonight and reinstall a set of Android development platform with eclipse+jdk+SDK
One install and configure Eclipse environment
1 Download the installation package
**Eclipse: **eclipse official download site, or directly download [eclipse-jee-indigo-SR1-linux-gtk.tar.gz](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ indigo/SR1/eclipse-jee-indigo-SR1-linux-gtk.tar.gz&url=http://mirror.bit.edu.cn/eclipse/technology/epp/downloads/release/indigo/SR1/eclipse-jee- indigo-SR1-linux-gtk.tar.gz&mirror_id=1082)
**JDK: **jdk official download site, or directly download jdk-7u1-linux-i586 .tar.gz
**SDK: **sdk official download site, or directly download android-sdk_r15-linux .tgz
2 Unzip the download package
**Unzip Eclipse: **tar zxvf eclipse-java-indigo-SR1-linux-gtk.tar.gz
**Unzip the JDK: **tar zxvf jdk-7u1-linux-i586.tar.gz
**Unzip the SDK: **tar zxvf android-sdk_r15-linux.tgz
Move jdk1.7.0_01 to the eclipse directory: mv jdk1.7.0_01 eclipse
3 Configure Eclipse and JDK environment variables
sudo vi /etc/profile
Add at the end of the file:
export JAVA_HOME=/home/yanggang/eclipse/jdk1.7.0_01
export JRE_HOME=/home/yanggang/eclipse/jdk1.7.0_01/jre
export CLASSPATH=.:
source /etc/profile // Make environment variables take effect
4 Create soft link, quick start
cd ~/bin
ln -s /home/yanggang/eclipse/eclipse eclipse
First check the environment variable: echo $PATH
If the environment variable does not contain /home/yanggang/bin, perform the following operation to add environment variable; otherwise, no need
Edit the .profile file of the current user (yanggang)
vi /home/yanggang/.profile
Configure environment variable PATH
PATH=/home/yanggang/bin:$PATH
export $PATH
5 Restart the system Ubuntu
source /home/yanggang/.profile (Do not restart the system, use the source command)
Input: java -version
The java version information appears, indicating that the installation is successful!
Now you can start eclipse
eclipse &
Two installation and configuration of the Android environment
1 Install android development plugin
(1) Open Eclipse, select help->Install New SoftWare ——> Add on the menu bar
(2)Enter the URL: https://dl-ssl.google.com/android/eclipse/ (If you make a mistake, please change https to http)
(3) Install all the way Next, restart Eclipse
2 Configure android sdk
(1) Click the menu window->preferences to enter the following interface
(2) Click the menu window->Android SDK Manager to download the SDK toolkit
(3) Click the menu window->AVD Manager to create an AVD emulator
**Additional: **
1 ) There is no android SDK and AVD Manager option under eclipse windows
**Solution: ** In eclipse window -> Customize Perspective -> Command Groups availability-> check the android SDK and AVD Manager option -> ok
2 ) Input adb in the terminal and output "bash: /home/homer/bin/adb: No such file or directory"
**Solution: ** It means that you are using 64-bit Linux and no 32-bit runtime library is installed. Install $ sudo apt-get install ia32-libs
3 ) Create a new Android project and prompt "R cannot be resolved to a variable" error. After deleting gen and bin, or clean project, gen will automatically generate R.java file
**Solution: ** Because the adb command is not available in 64-bit ubuntu system, Project --> Build Project to generate gen/R.java, refer to 2) Install 32-bit runtime library, then clean and restart gen.
Reference recommendation:
Installing the SDK (Android Developer)
Windows build Eclipse+JDK+SDK Android
Recommended Posts