Install Javajdk6 under CentOS6.2

Source: Internet
Author: User
1. go to the official website to download jdk. I downloaded the jdk-6u31-linux-i586.bin (the original did not give the address sorry, now add http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html) 2. suroot & n

1. go to the official website to download jdk. I downloaded the jdk-6u31-linux-i586.bin (originally did not give the address sorry, now add a new http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html)

2. su root // switch to the root account

3. mkdir/usr/java // Create a java folder under the usr Directory

4. mv jdk-6u31-linux-i586.bin/usr/java // Move the downloaded jdk file to the folder you just created on the premise that you download the jdk stored in the directory

5. chmod 777 jdk-bu31-linux-i586.bin // to the installation package to execute permissions on the premise is in the/usr/java Directory

6 ../jdk-6u31-linux-i586.bin // installation successful when none appears

7. vi/etc/profile // set environment variables

Add

Export JAVA_HOME =/usr/java/jdk1.6.0 _ 31 export CLASSPATH =.: % JAVA_HOME %/lib/dt. jar: % JAVA_HOME %/lib/tools. jar export PATH = $ PATH: $ JAVA_HOME/bin

Press Esc to exit the input: wq

Note: The delimiter for linux environment variables is colon ":" Rather than semicolon ";"

Then restart the machine reboot.

Finally, enter java-version to view and install the jdk version.

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.