JAVA: Instalasi OpenJDK 1.7 di Ubuntu 22.04
Revision as of 07:18, 14 August 2023 by Onnowpurbo (talk | contribs)
Sumber: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-22-04
sudo apt update
Cek java yang tersedia
java -version
Output
apt install openjdk-11-jre-headless # version 11.0.20+8-1ubuntu1~22.04, or apt install default-jre # version 2:1.11-72build2 apt install openjdk-17-jre-headless # version 17.0.8+7-1~22.04 apt install openjdk-18-jre-headless # version 18.0.2+9-2~22.04 apt install openjdk-19-jre-headless # version 19.0.2+7-0ubuntu3~22.04 apt install openjdk-8-jre-headless # version 8u382-ga-1~22.04.1
Install
apt -y install openjdk-17
Managing Java
sudo update-alternatives --config java
Managing Javac
sudo update-alternatives --config javac
Edit environment
sudo vi /etc/environment
echo $JAVA_HOME
Output
/usr/lib/jvm/java-11-openjdk-amd64