Linux Ubuntu 12.04 is installed by default on the OPENJDK

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.