Install jdk in CentOS 7 and jdk in centos 7
View System Version
[root@zabbix ~]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) [root@zabbix ~]# uname -aLinux zabbix.com 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Download the jdk package. Here I chose the oracle java tar.gz package.
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Then you can use the wget command to download. If the wget command is not available, yum install wget-y
Start to install jdk, first decompress
tar -xf jdk-8u65-linux-x64.gz /usr/local/ln -s /usr/local/jdk1.8.0_65 /usr/local/java/
Add Environment Variables
[root@zabbix ~]#vim /etc/profile.d/java.shJAVA_HOME=/usr/local/javaJAVA_BIN=$JAVA_HOME/binJRE_HOME=$JAVA_HOME/jreJRE_BIN=$JRE_HOME/binCLASSPATH=$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/jre/lib/charsets.jarPATH=$PATH:$JAVA_BIN:$JRE_BIN:$CLASSPATH
Check whether the installation is successful
[root@zabbix ~]# java -versionjava version "1.8.0_65"Java(TM) SE Runtime Environment (build 1.8.0_65-b17)Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
If the machine comes with jdk, uninstall it first. To avoid subsequent impacts.