The content is simple ~ ~ ~ The new person asks for care ~ ~
How to install JDK under CentOS-this is centos6.5.
1. First check to see if the current installed CentOS comes with a JDK
--View JDK version: Java-version
--Use the command to see if it comes with Jdk:rpm-qa | grep java
--Unload your own jdk:rpm-e--nodeps [JDK inside the virtual machine]
EG:RPM-E--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
2. Start the installation
(1). Install dependencies required for installation of JDK
--Yum Install glibc.i686
(2). Unzip the pre-prepared JDK, no JDK can be downloaded from CentOS
--CentOS Download Jdk:wget http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
--Unzip the JDK to the/usr/local directory: TAR–XVF xxx.tar.gz-c/usr/local
(3). Configure Environment Variables Vi/etc/profile
Method One:
Added under Export PATH USER LOGNAME MAIL HOSTNAME histsize Histcontrol
Export java_home=/usr/local/jdk* (JDK directory name)/
Export path= $JAVA _home/bin: $PATH
Method Two:
java_home=/usr/local/src/java/jdk*
Path= $JAVA _home/bin: $PATH
Export Java_home PATH
(4). Reload the configuration file
--Use command: Source/etc/profile
(5). Check if the JDK version is installed successfully!
Linux CentOS installation JDK