linux版本 :centos 8
1.能联网的情况下:
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
2.mkdir /usr/local/java
tar zxvf jdk-17_linux-x64_bin.tar.gz -C /usr/local/java
3./etc/profile增加:
export JAVA_HOME=/usr/local/java/jdk-17.0.9
export CLASSPATH=.:
J
A
V
A
H
O
M
E
/
j
r
e
/
l
i
b
/
r
t
.
j
a
r
:
{JAVA_HOME}/jre/lib/rt.jar:
JAVAHOME/jre/lib/rt.jar:{JAVA_HOME}/lib/dt.jar:
J
A
V
A
H
O
M
E
/
l
i
b
/
t
o
o
l
s
.
j
a
r
e
x
p
o
r
t
P
A
T
H
=
{JAVA_HOME}/lib/tools.jar export PATH=
JAVAHOME/lib/tools.jarexportPATH={JAVA_HOME}/bin:$PATH
4.source /etc/profile