Install jdk1.6 on Red Hat Enterprise Linux 4 Server

Source: Internet
Author: User

1: Download jdk6.0

Address: http://java.sun.com/javase/downloads/index.jsp
I downloaded a jdk-6u11-linux-i586.bin.

2: run the CD command to go to the directory where the JDK file is stored and release the compressed package jdk1.6.0 _ 11,

3: Use command: Sh jdk-6u11-linux-i586.bin, press enter until appears

Do you agree to the above license terms? [Yes or No] input: Yes

4. After the release is completed, Run ls to generate a folder in the current directory: jdk1.6.0 _ 011

5. Change the name and execute the command mV./jdk1.6.0 _ 11./jdk6.0. then execute LS and find that the name has been changed to jdk6.0. (this step is not required, but it is mainly for convenience)

6. Change the character set to UTF-8:

[Root @ qudee jdk6.0] # export lang = en_us

[Root @ qudee jdk6.0] # export lc_all = en_us

7. Run the command:./bin/Java-version,

Java version "1.6.0 _ 11"

Java (TM) se Runtime Environment (build 1.6.0 _ 11-b05)

Java hotspot (TM) server VM (build 1.6.0 _ 011-b05, mixed mode)

Then execute Java-version

Java version "1.4.2"

Gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)

Copyright (c) 2006 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is no

Warranty; not even for merchantability or fitness for a particle purpose.

An error occurred because the environment variable is not set.

8. Set environment variables and execute command VI/etc/profile

The edit box appears.

Hostname = '/bin/hostname'

History Size = 1000

Path for adding environment variables below:

Java_home =/opt/Java/jdk6.0

Class_path = $ java_home/lib: java_home/JRE/lib: java_home/lib/tools. jar: $ class_path

Path = $ java_home/bin: $ path

Export path user LOGNAME mail hostname histsize inputrc added after this line

Export class_path java_home

OK! Press ESC to release the edit box, press SHIFT +;, and enter WQ (write, save, and release)

Restart the system.

9. Check whether the installation is successful. Enter the command: Java-version

Message:

Java version "1.6.0 _ 02"

Java (TM) se Runtime Environment (build 1.6.0 _ 02-b05)

Java hotspot (TM) server VM (build 1.6.0 _ 02-b05, mixed mode)

The installation is successful!

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.