Install jdk1.6.0 _ 37 in centos 6.2

Source: Internet
Author: User

First, check whether rpm-Qa | grep Java is installed.

 

Environment

The system version is cenos 6.2.

JDK: jdk-6u37-linux-i586.bin

 

1. Download

Download the appropriate version of jdk-6u37-linux-i586.bin from the Oracle official website and upload it to the/usr/Java directory. (If this directory is not available, create the mkdir-P/usr/Java directory first)

: Http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u37-download-1501634.html

 

Ii. Installation

    1. Modify executable: chmod 777 jdk-6u37-linux-i586.bin
    2. Perform installation./jdk-6u37-linux-i586.bin

When JDK is installed, the JDK installation license is displayed. Press a space to flip the page.ProgramI will ask you if you agree to the above agreement. Of course you agree. Enter 'yes' and decompress JDK to the current directory. The decompression progress is displayed on the screen. After decompression, a new directory named JDK ** will be created under the/usr/Java directory. At least JDK has been installed on cenos.

 

3. Configure Environment Variables

After installation, you must configure the environment variable VI/etc/profile.
Add the following lines at the end:
Export java_home =/usr/Java/jdk1.6.0 _ 37
Export jre_home =/usr/Java/jdk1.6.0 _ 37/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ jre_home/bin: $ path

Note: You need to change the JDK name to the current JDK version you downloaded.
Set JDK and save and exit. Run source/etc/profile or restart.

 

4. verify whether the installation is successful

Run the Java-version command to verify whether the system configuration takes effect.

Or echo $ java_home

 

Note: you do not need to delete the original JDK environment of the system, otherwise it will be very troublesome!

Related Article

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.