Dev Ops
ubuntu 14 버전에서 자바 1.8 설치
코딩범고래
2022. 7. 21. 13:54
14버전에서는 놀랍게도 apt-get으로 설치가 안된다.
리포지토리를 추가해야 하는데..
리포지토리를 추가해야 하는데..
놀랍게도 add-apt-repository또한 명령어가 없다고 나온다
bash: add-apt-repository: command not found
이럴 때는
apt install software-properties-common
를 입력하여 software-properties-common을 설치해 줘야 한다.
설치한 뒤 다시 실행해주자..
# add repository
sudo add-apt-repository ppa:openjdk-r/ppa
# update cache
sudo apt-get update
# install openjdk-8-jdk
sudo apt-get install openjdk-8-jdk
# At this time, if you check the version of java/javac,
# you will see the version of JAVA 7
# You need to update alternatives for java and javac
# You can find the new one for the java-8-openjdk-amd64
sudo update-alternatives --display javac
# Configure(select) the version of java & javac you want to use by interactive mode
sudo update-alternatives --config java
sudo update-alternatives --config javac
# Now you can see 1.8.0_171 for the version of java and javac
java -version
javac -version
이제 자바가 잘 실행된다 무야호~