OPENJDK is installed by default in Ubuntu 12.04, but this JDK is a lot more problematic because you can't even start eclipse, so you still need to install the JDK yourself.
1. Download Jdk6
JDK6: http://download.java.net/jdk6/, according to the operating system selection of the corresponding installation package, my is Ubuntu 12.04 32bit, So the downloaded file is Jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin,
2. Create a folder under/usr/local:
sudo mkdir java
Cd/usr/local/java
Copy the downloaded Jdk6 jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin file to the/usr/local/java directory;
3. Modify the permissions of the Jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin file to allow it to run:
sudo chmod u+x jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin
4. Installing JDK6
./jdk-6u23-ea-bin-b03-linux-i586-18_oct_2010.bin
After executing this executable program, the JDK6 package is actually extracted to the current directory;
5. Modifying environment variables
sudo vim/etc/environment
Set the variables inside to:
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/java/jdk1.6.0_38/bin"
classpath=.:/ Usr/local/java/jdk1.6.0_38/lib
Java_home=/usr/local/java/jdk1.6.0_38
Save exit.
Configure profile:
sudo vim/etc/profile
Add the following at the end of the file:
Export java_home=/usr/local/java/jdk1.6.0_38
Export JRE_HOME=/USR/LOCAL/JAVA/JDK1.6.0_38/JRE
Export path= $PATH:/usr/local/java/jdk1.6.0_38/bin
Export Classpath=./:/usr/local/java/jdk1.6.0_38/lib:/usr/local/java/jdk1.6.0_38/jre/lib
Once configured, apply:
sudo source/etc/profile
This article is from the "opportunity is left to prepare the NPC" blog, please be sure to keep this source http://qiuhunluola.blog.51cto.com/6417741/1677059
Linux Ubuntu 12.04 is installed by default on the OPENJDK