본문 바로가기
Linux/프로그램설치

[Linux] centos7 여러버전 jdk 관리(설치한 jdk 정리안될때)

by 평범한kiki 2023. 5. 13.

1. 설정된 기본 자바 확인

java -version
javac -version



2. 심볼릭 링크 확인하기
-현재 심볼릭 링크 확인하기

alternatives --list

## 위에 검색 결과 ##
libnssckbi.so.x86_64    auto    /usr/lib64/pkcs11/p11-kit-trust.so
ld      auto    /usr/bin/ld.bfd
mta     auto    /usr/sbin/sendmail.postfix
jre_openjdk     auto    /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64
jre_11  auto    /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64
jre_11_openjdk  auto    /usr/lib/jvm/jre-11-openjdk-11.0.19.0.7-1.el7_9.x86_64
javac   auto    /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/bin/javac
java_sdk_openjdk        auto    /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64
java_sdk_11     auto    /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64
java_sdk_11_openjdk     auto    /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64


-심볼릭 링크 제거

sudo  alternatives --remove java /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/bin/java



3. yum으로 설치한 자바 확인
- yum으로 설치한 자바 확인하기

[@instance-2 ~]$ yum list installed | grep "java"
java-11-openjdk.x86_64               1:11.0.19.0.7-1.el7_9          @updates
java-11-openjdk-devel.x86_64         1:11.0.19.0.7-1.el7_9          @updates
java-11-openjdk-headless.x86_64      1:11.0.19.0.7-1.el7_9          @updates
javapackages-tools.noarch            3.4.1-11.el7                   @base
python-javapackages.noarch           3.4.1-11.el7                   @base
tzdata-java.noarch                   2023c-1.el7                    @updates

 

 

- yum으로 설치한 자바 지우기

[@instance-2 ~]$ sudo yum remove java-11-openjdk.x86_64
[@instance-2 ~]$ sudo yum remove java-11-openjdk-headless.x86_64


- 지운거 확인

[@instance-2 ~]$ yum list installed | grep "java"
javapackages-tools.noarch            3.4.1-11.el7                   @base
python-javapackages.noarch           3.4.1-11.el7                   @base
tzdata-java.noarch                   2023c-1.el7                    @updates

[@instance-2 ~]$ alternatives --list
libnssckbi.so.x86_64    auto    /usr/lib64/pkcs11/p11-kit-trust.so
ld      auto    /usr/bin/ld.bfd
mta     auto    /usr/sbin/sendmail.postfix



참고) 
//현재 심볼릭 관련
https://veneas.tistory.com/entry/Linux-Javajdk-%EC%97%AC%EB%9F%AC-%EB%B2%84%EC%A0%84-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-alternatives
//yum으로 설치한 자바 확인
https://narup.tistory.com/259

'Linux > 프로그램설치' 카테고리의 다른 글

[Linux] SSH 공개키 만들기  (0) 2023.05.13