1、安装jdk
地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
查看linux系统位数:getconf LONG_BIT
上传包到服务器:yum -y install lrzsz
解压文件:tar xvf jdk-8u181-linux-x64
查看jdk路径:/usr/local/software/jdk1.8.0_181
修改profile
vi /etc/profile
添加
export JAVA_HOME=/usr/local/software/jdk1.8.0_181
export CLASSPATH=.:
J
A
V
A
H
O
M
E
/
l
i
b
/
d
t
.
j
a
r
:
JAVA_HOME/lib/dt.jar:
JAVAHOME/lib/dt.jar:JAVA_HOME/lib/tools.jar
export PATH=
J
A
V
A
H
O
M
E
/
b
i
n
:
JAVA_HOME/bin:
JAVAHOME/bin:PATH
重新加载/etc/profile(在etc路径下执行)
source profile
检查jdk版本