Install JDK 6 in centos, RedHat, and Ubuntu

Source: Internet
Author: User

Centos 32-bit Operating System

1. Download a good jdk-6u23-linux-i586.bin, you can go to the official website download can also download from the following link:

:

Http://dl.dbank.com/c0sxxbz5vb

Copy the downloaded jdk-6u23-linux-i586.bin to the directory you want to install, for example, under/develop


2. Facility permissions. Then, all users can modify the content in/develop (you can set it as needed)

Run the command [zhengchunxi @ centos ~] $
Sudo chmod A + rwx-r/develop


3. Switch to the/develop directory and unzip the jdk-6u23-linux-i586.bin

Run the command [zhengchunxi @ centos ~] $
CD/develop
[Zhengchunxi @ centos develop] $./jdk-6u23-linux-i586.bin

[Zhengchunxi @ centos ~] $ Sudo chmod A + rwx-r/develop

Decompress the package and generate the jdk1.6.0 _ 23 folder (the folder name is very important and corresponds to the path)


4. Set Environment Variables

If RedHat is used, create a java. Sh file in the/etc/profile. D folder and copy the configuration content to the java. Sh file.

For Ubuntu, the profile file in/etc has only one line at the end. Add the configuration information to the beginning of the last line.

Under centos 6.0

Run the command [zhengchunxi @ centos/] $
Gedit/etc/profile
Open the profile configuration file.

Unset I
Unset pathmunge

Add the following content to the rows:

# Setting Java environment variables

Export java_home =/develop/jdk1.6.0 _ 23
Export jre_home =/develop/jdk1.6.0 _ 23/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath

Export Path = $ path: $ java_home/bin: $ jre_home/bin: $ home/bin


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.