Installation of JDK under CentOS (linux)

Time:2019-10-9

Installation of CentOS (linux) JDK


The first blog has some shortcomings, please give us more advice. ^^
There are a lot of JDK articles downloaded from Linux on the Internet and I won’t copy them.
This article describes how novices can skillfully install JDK under linux.


CentOS 7.4 (Tencent Cloud)
Java SE Development Kit 8u172 (JDK version is best stable, especially for our novice, the latest version of various pits…)
JDK Official Website Download


Software:
WinSCP
Xshell 6


download

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz

Wget: is a commonly used download instruction for linux. Wget is followed by the specified URL address for download. Linux Command Complete
Installation of JDK under CentOS (linux)

decompression

tar -zxvf jdk-8u172-linux-x64.tar.gz

Installation of JDK under CentOS (linux)

Tar instruction


Open WinSCP and you’ll see the JDK zip package and folder you just downloaded (both Xshell 6 and WinSCP login in the / root directory)
Installation of JDK under CentOS (linux)

Create a new directory (I call it Environment) and move the unzipped JDK folder into the new directory and rename it JDK (the advantage is that you don’t need to change the configuration file to upgrade jdk, just overwrite it directly)
Installation of JDK under CentOS (linux)

Open profile file under / etc
Installation of JDK under CentOS (linux)

Add code

#set java environment
JAVA_HOME=/root/Environment/jdk
JRE_HOME=/root/Environment/jdk/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

Open Xshell 6 inputsource /etc/profileLet profile modifications take effect
Installation of JDK under CentOS (linux)

Enter againjava -versionDisplay the following content and configure successfully!
Installation of JDK under CentOS (linux)

This concludes the small white tutorial on JDK installation under CentOS (linux).

Recommended Today

Front-end core tools: yarn, NPM, and CNPM how can they be used together elegantly?

A front end that doesn’t work well with package managers is an entry-level front end that doesn’t work wellwebpackThe front end is a primary front end Three package managers can be used together, as long as you are bold enough, no problem! Recommend two articles Handwritten React scaffolding Handwritten Vue scaffolding Front-end performance optimization incomplete […]