관리 메뉴

NineTwo meet you

Ubuntu 20.04 - OpenJDK 11 설치 본문

기타

Ubuntu 20.04 - OpenJDK 11 설치

NineTwo 2022. 5. 30. 23:33
반응형

1. Install OpenJDK ( Using apt)

$ sudo apt-get update && sudo apt-get upgrade

2. Install openjdk-11-jdk

$ sudo apt-get install openjdk-11-jdk
더보기

2-1. OpenJRE 만 설치하고 싶다면

$ sudo apt-get install openjdk-11-jre

3. Check java version

$ java -version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

$ javac -version
javac 11.0.9.1

4. Setting Preferences

$ vim ~/.bashrc
# ~/.bashrc
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
export PATH=$PATH:$JAVA_HOME/bin
$ source ~/.bashrc
$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64

1. Delete OpenJDK 

$ sudo apt-get purge openjdk*

2. Check java version

$ java --version
bash: /usr/bin/java: No such file or directory
반응형
Comments