It is easy to forget the setting procedure of "JAVA_HOME", so I will show it as a memorandum.
$ cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)
Check the JDK path. If it is not installed, please install the JDK accordingly.
$ dirname $(readlink $(readlink $(which java)))
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64/jre/bin
Set the JAVA_HOME path.
$ cp -pi /etc/profile{,.org}
$ vi /etc/profile
$ diff /etc/profile{,.org}
86,90d85
<
< export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64
< export PATH=$PATH:$JAVA_HOME/bin
< export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
<
$ source /etc/profile
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64
that's all
Recommended Posts