JDK 1.7 installation details (CentOS 6.4)

Source: Internet
Author: User

Install JDK (Java Development Kit) in CentOS 6.4)

1) download JDK 1.7 (1.7.0 _ 25)

Is:

Http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Select "Accept License Agreement"

Select a 64-bit rpm package download: jdk-7u25-linux-x64.rpm

2) install JDK 1.7

Create a java folder under usr and run the terminal command: (switch to root: su root)

[Root @ www.bkjia.com linux] # cd/usr

[Root @ www.bkjia.com linux] # mkdir java

[Root @ www.bkjia.com linux] # mv 'jdk path after download' 'move jdk path' (directly drag the folder to the terminal to automatically add the path)

Installation

[Root @ www.bkjia.com linux] # rpm-ivh 'jdk installation package Path'

Just wait for Installation

3) environment variable configuration

Configure JAVA_HOME

# ExportJAVA_HOME = <jdk-install-dir>

<Jdk-install-dir> indicates the jdk installation path (directly drag the folder location), for example,/usr/java/jdk1.7.0 _ 25.

Configure PATH

# Export PATH = $ JAVA_HOME/bin: $ PATH4) check that the environment variable JAVA_HOME has been set for the root user

# Sudo env | grep JAVA_HOME5) Add to file/etc/sudoers

Open the file:

[Root @ www.bkjia.com linux] # vim/etc/sudoers

Enter the editing status:

Press the "I" Key

Add the following line:

Defaults env_keep + = JAVA_HOME Ø exit the editing status:

Press Esc on the keyboard.

Save and exit the file

Press the "Shift" + ":" key on the keyboard, enter: wq; or force Exit: wq !; Do not save the exit file: q

Install and configure JDK 7 in CentOS 6.3

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.