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