Shell/Bash: debian install java Example


Shell/Bash Example: This is the "debian install java" Example. compiled from many sources on the internet by

install openjdk 8 sdk on ubuntu

sudo apt-get install openjdk-8-jdk

debian install java

# If you want java 11:
sudo apt install -y default-jre

# If you want java 8:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common
wget -qO - | sudo apt-key add -
sudo add-apt-repository --yes
sudo apt update
sudo apt install -y adoptopenjdk-8-hotspot

# Switch java version
sudo update-alternatives --config java

install java debian 8

echo deb jessie-backports main | sudo tee /etc/apt/sources.list.d/jessie-backports.list
echo 'Acquire::Check-Valid-Until "false";' | sudo tee -a /etc/apt/apt.conf
sudo apt update
sudo apt -t jessie-backports install openjdk-8-jre

linux change java

sudo update-java-alternatives -s java-8-oracle
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/

* Summary: This "debian install java" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!