// 설치가능한 jdk 확인
# yum list java*jdk-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: d36uatko69830t.cloudfront.net
* extras: d36uatko69830t.cloudfront.net
* updates: d36uatko69830t.cloudfront.net
Available Packages
java-1.6.0-openjdk-devel.x86_64
java-1.7.0-openjdk-devel.x86_64
java-1.8.0-openjdk-devel.i686
java-1.8.0-openjdk-devel.x86_64
java-11-openjdk-devel.i686
java-11-openjdk-devel.x86_64
# yum install java-11-openjdk-devel.x86_64
# java --version
openjdk version "11.0.11" 2021-04-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode, sharing)
// javac 설치경로 확인
# which javac
/bin/javac
// /bin/javac에 연결된 원본파일 위치 확인
# readlink -f /bin/javac
/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-1.el7_9.x86_64/bin/javac
JAVA_HOME이 될 경로
/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-1.el7_9.x86_64
vi /etc/profile
// 하단에 내용 추가
...
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-1.el7_9.x86_64
설정 후 명령어 입력
source /etc/profile
# echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-1.el7_9.x86_64