Install jdk in CentOS 7 and jdk in centos 7

Source: Internet
Author: User

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.

Related Article

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.