CentOS installation JDK-1.7, centosjdk-1.7
Note: All of the following operations are performed in the CentOS 6.5 x86_64-bit system.
# Preparations #
Before downloading with rpm, check whether the system has installed JDK. If not, go to the official installation step.
# rpm -qa | grep jdk
First of all need to download JDK-1.7, we choose to go to the official website to download. However, the downloading process is troublesome. The default download path cannot be downloaded directly using the wget command. The method is as follows:
1) Go to Oracle's official website, such as: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
2) Select Accept License Agreement as follows:
3) Click
At this time, the browser will download it, copy the official address downloaded by the browser, and then use wget to obtain it, for example:
# Cd/usr/local/src # wget http://download.oracle.com/otn-pub/java/jdk/7u72-b14/jdk-7u72-linux-x64.rpm? AuthParam = 1419939909_a8de536de423ecfac6886b3bf6567c0e ...... 19:50:35 (292 KB/s)-saved "jdk-7u72-linux-x64.rpm? AuthParam = 1419939909_a8de536de423ecfac6886b3bf6567c0e "[126699825/126699825]) # ls/usr/local/srcjdk-7u72-linux-x64.rpm? AuthParam = 1419939909_a8de536de423ecfac6886b3bf6567c0e # Music jdk-7u72-linux-x64.rpm? AuthParam = 1419939909_a8de536de423ecfac6886b3bf6567c0e jdk-7u72-linux-x64.rpm
# Installation of JDK-1.7 #
Install the downloaded JDK-1.7:
# cd /usr/local/src# rpm -Uvh jdk-7u72-linux-x64.rpmPreparing... ########################################### [100%] 1:jdk ########################################### [100%]Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar...# rpm -qa | grep jdkjdk-1.7.0_72-fcs.x86_64
The default JDK installation path is/usr/java:
# ls /usr/java/default jdk1.7.0_72 latest
Add the JAVA bin directory to the current environment:
# vim /etc/profileexport JAVA_HOME=/usr/java/jdk1.7.0_72export PATH=$PATH:/usr/local/mysql/bin:$JAVA_HOME/bin# source /etc/profile
So far, the JDK environment has been installed.