openjdk 1.8 설치 - centos7

반응형
반응형

 

 

open-jdk 1.8 설치 및 확인

 

yum으로 설치 

# yum install -y java-1.8.0-openjdk
# yum install -y java-1.8.0-openjdk-devel

 

설치 확인

[root@test-1 ~]# rpm -qa | grep openjdk
java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64
java-1.8.0-openjdk-devel-1.8.0.282.b08-1.el7_9.x86_64

 

 

환경변수 등록 및 확인

 

/etc/profile 파일에 환경변수 등록

JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar

export JAVA_HOME PATH CLASSPATH

 

환경변수 적용

source /etc/profile

 

확인

[root@test-1 jvm]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64

[root@test-1 jvm]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/bin

[root@test-1 jvm]# echo $CLASSPATH
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/jre/lib:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/lib/tools.jar

 

어느 경로에서나 java 명령어를 실행할 수 있습니다

[root@test-1 ~]# java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

[root@test-1 ~]# javac -version
javac 1.8.0_282

 

 

 

 

 

반응형

댓글

Designed by JB FACTORY

loading