Basic service series-centos7 install JDK

Preface##

This article is the first in the basic service series, and other services will be built in the future.

Install JDK

Download from the official websiteJDK8

8 u171 odd-numbered version, it is the version with bug fixes and all passed inspections, the official strongly recommends this version

8 u172 Even-numbered version, including all the content of odd-numbered version, and bug fixes that have not been verified

Install upload tool##

Install lrzsz for uploading files. yum install lrzsz

Upload JDK file##

Unzip##

tar -xvf jdk-8u171-linux-x64.tar.gz

Set environment variables##

vi /etc/profile

# set java environment
JAVA_HOME=/usr/java/jdk1.8.0_171
JRE_HOME=/usr/java/jdk1.8.0_171/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

Effective##

source /etc/profile

verification##

java -version

java

javac

reference##

There are other installation methods, you can refer to the next.

Three ways to install JDK under CentOS

Recommended Posts

Basic service series-centos7 install JDK
Basic Service Series-Centos7 Install Node.js10
Centos 7 install jdk and package service service
CentOS install jdk
Linux Centos7 install jdk1.8
CentOS7 install JDK8, tomcat8
Install JDK10+ on Ubuntu
Install JDK in Ubuntu19.10
Centos 7 install JDK (Linux install jdk)
CentOS 7 install JAVA environment (JDK 1.8)
Tencent Cloud Centos install jdk8
Install Java JDK8 under CentOS6
5.1. CentOS@ install JDK1.8 graphic tutorial
How to install jdk1.8 on centOS7
Install JDK8 in rpm on CentOS7
CentOS 8 install Git and basic configuration
Minimal install JDK 1.8 tutorial in CentOS 7
CentOS8 install jdk8 / java8 tutorial (recommended)
Linux CentOS 7 install JDK detailed steps
CentOS 8 - install and configure NFS service
Install JDK1.8 original under Ubuntu Kylin
Centos7 uninstall openJdk, and install JDK1.8