After referring to a lot of online materials, I finally set up the adnroid development platform under Ubuntu 11.04. Due to the poor content on the network, I took a lot of detours, AND THE PATH environment variable settings were incorrect, you cannot log on to the system. Therefore, the content is verified in person. Reliable!
Sun JDK is required for the normal development of Android in Ubuntu, but openjdk is provided in Ubuntu 11.04. According to the Internet, there will be many problems. Okay, I have not verified whether openjdk will actually cause problems. I hope you can give me some advice. Well, install Sun JDK first.
1. Install Sun JDK
1. Download JDK
Download the JDK from Oracle. Click here.
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
I downloaded Java SE Development Kit 6 Update 26.
Linux x86-self extracting Installer (81.20 MB) jdk-6u26-linux-i586.bin
Place the file in the current user's home directory.
2. Install JDK
Open the terminal, that is, search for termianal (or use the shortcut CTRL + ALT + T to open the terminal), and then enter the command:
sudo cp jdk-6u26-linux-i586.bin /optsudo chmod u+w jdk-6u26-linux-i586.binsudo ./opt/jdk-6u26-linux-i586.bin
(The user password to be entered is prompted)
Wait until the installation is complete and the/opt/jdk1.6.0 _ 26 directory is generated.
3. Set system variables in the java_home Environment
Continue to enter commands in the terminal
sudo gedit /etc/profile
Add the following code before opening the umask 022 statement in the Text Editor:
export JAVA_HOME=/opt/jdk1.6.0_26export JRE_HOME=/opt/jdk1.6.0_26/jreexport CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
Close the text editor and save the settings. Enter the following command in the terminal:
sudo gedit /etc/environment
Add the following statement to the end of the opened file:
export JAVA_HOME=/opt/jdk1.6.0_26export JRE_Home=/opt/jdk1.6.0_26/jreexport CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
4. manually configure JDK
Because openjdk is installed in Ubuntu 11.04 by default, You need to manually configure Sun JDK. In the terminal:
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.6.0_26/bin/java 300sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_26/bin/javac 300
Use the above command to add Sun JDK to the Java menu.
Run the following command:
sudo update-alternatives --config java
Select the number before Sun JDK.
5. Verify JDK Installation
Run
Java-version
If the displayed system shows that Java is the just-installed Java, the JDK configuration is successful.
2. Install eclipse
First, you need to download the Eclipse IDE program from the eclipse official website. In my tests, if you download and install eclipse directly in the Ubuntu Software Center, you will not be able to install the ADT plug-in. Rz
Stamp here
Http://www.eclipse.org/downloads/
The downloaded file is eclipse-java-helios-sr2-linux-gtk.tar.gz. I decompress the file under the $ home/eclipse folder. Run eclipse directly in this folder. You can see the familiar eclipse startup interface.
3. download and install the ADT plug-in
The last step is the installation of the ADT plug-in. After completing the above work, this step is similar to the installation of the ADT plug-in under windows. All are selected in the eclipse menuHelp>Install new software....
See http://developer.android.com/sdk/eclipse-adt.html
4. Download and configure the android SDK
Because I am using the meizu M9 phone, So I downloaded the M9-SDK. In eclipse with ADT installed, first select Window> preferences to configure the SDK directory
Picture from M9 SDK development documentation
, Click the android item on the left of the dialog box and select create ACD,Window> Android SDK and AVD Manager.
For this step, see http://developer.android.com/sdk/installing.html
Well, above.
References:
M9sdk.
Android develop. http://developer.android.com/sdk/index.html
Install JDK in Ubuntu 10.10 to configure eclipse and tomcat. http://developer.51cto.com/art/201012/238581.htm
The perfect solution for Ubuntu cannot log on to. http://blog.csdn.net/ameyume/archive/2011/05/01/6378212.aspx After configuring Environment Variables
This work was created by hyrtster and licensed using the knowledge sharing signature-non-commercial use-share 3.0 unported license agreement in the same way.