-
Unzip command:
tar -zxvf jdk-8u211-linux-x64.tar.gz
-
Create a soft link (can be omitted):
ln -s jdk1.8.0_211/ jdk_current
-
Editing system environment variables:
vi /etc/profile
[A start editing] -
Join as follows:
export JAVA_HOME=/home/ryan/app/jdk_current export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH 注意标点符号,JAVA_HOME是jdk的路径
-
Just set the variable load
source /etc/profile
-
Test whether the installation is successful
- then enter java -version displays the version information jdk, etc.
- input javac javac command will display this help and jdk environment variable configuration succeeded
[ryan@localhost app]$ java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
[ryan@localhost app]$ javac -version
javac 1.8.0_211
Linux Centos 7 configuration jdk
Guess you like
Origin blog.csdn.net/zh554275855/article/details/89829368
Recommended
Ranking