If there is a JDK environment on the Linux server, this step can be ignored, and the installation of the second section of the link. If there is no JDK, first to the Oracle official website to download JDK, Download.
JDK extract can according to their actual situation to want to extract the path, here we extract to unzip
/usr/java/jdk1.8 , as shown below:
cd /usr/javatar -zxvf jdk-xxxx.tar.gzmv jdk-xxxx jdk1.8...vi /etc/profileexport JAVA_HOME=/usr/java/jdk1.8export PATH=$PATH:$JAVA_HOME/bin
Then, we use the
. /etc/profile to enable the configuration to take effect immediately.
PS: If the authority is insufficient, please use the sudo command
Finally, we input
java -version, according to the following information:
java version "1.8.0_60"Java(TM) SE Runtime Environment (build 1.8.0_60-b27)Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)