install java ubuntu
sudo apt-get install openjdk-8-jdk
0
6
Thank you!
6
0
4.1
10
sudo apt install default-jre # installs java
sudo apt install default-jdk # installs javac
Thank you!
10
0
4.33
9
sudo apt install default-jre
Thank you!
9
0
4
2
#Install java in Linux
sudo apt install openjdk-11-jre-headless -y # version 11.0.10+9-0ubuntu1~20.04, or
sudo apt install default-jre -y # version 2:1.11-72
sudo apt install openjdk-8-jre-headless -y # version 8u282-b08-0ubuntu1~20.04
sudo apt install openjdk-13-jre-headless -y # version 13.0.4+8-1~20.04
sudo apt install openjdk-14-jre-headless -y # version 14.0.2+12-1~20.04
Thank you!
2
0
4
2
// for debian & debian based linux distributions
sudo su or su -
echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A
apt-get update
Ctrl + D or exit
// for Ubuntu, Linux Mint, Pop!_OS or Zorin Os
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
// Now you can install Oracle JDK 16 on Debian / Ubuntu and Linux distributions based on these:
//Install and make Oracle JDK 16 the default JDK version:
sudo apt install oracle-java16-installer --install-recommends
//Install but don't make Oracle JDK 16 the default JDK version:
sudo apt install oracle-java16-installer --no-install-recommends
//To check which Java version is set as default on your system
java -version or javac -version
//To accept the Oracle Java 16 license automatically
echo oracle-java16-installer shared/accepted-oracle-license-v1-2 select true | sudo /usr/bin/debconf-set-selections
//If that doesn't work, also try this command:
echo oracle-java16-installer shared/accepted-oracle-licence-v1-2 boolean true | sudo /usr/bin/debconf-set-selections
Thank you!
2
0
3.8
5
#Install java in Linux
sudo apt install openjdk-11-jre-headless -y # version 11.0.10+9-0ubuntu1~20.04, or
sudo apt install default-jre -y # version 2:1.11-72
sudo apt install openjdk-8-jre-headless -y # version 8u282-b08-0ubuntu1~20.04
sudo apt install openjdk-13-jre-headless -y # version 13.0.4+8-1~20.04
sudo apt install openjdk-14-jre-headless -y # version 14.0.2+12-1~20.04
Thank you!
5
0
4
6
// for debian & debian based linux distributions
sudo su or su -
echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A
apt-get update
Ctrl + D or exit
// for Ubuntu, Linux Mint, Pop!_OS or Zorin Os
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
// Now you can install Oracle JDK 16 on Debian / Ubuntu and Linux distributions based on these:
//Install and make Oracle JDK 16 the default JDK version:
sudo apt install oracle-java16-installer --install-recommends
//Install but don't make Oracle JDK 16 the default JDK version:
sudo apt install oracle-java16-installer --no-install-recommends
//To check which Java version is set as default on your system
java -version or javac -version
//To accept the Oracle Java 16 license automatically
echo oracle-java16-installer shared/accepted-oracle-license-v1-2 select true | sudo /usr/bin/debconf-set-selections
//If that doesn't work, also try this command:
echo oracle-java16-installer shared/accepted-oracle-licence-v1-2 boolean true | sudo /usr/bin/debconf-set-selections
Thank you!
6
0
4
6
sudo apt install default-jdk
Thank you!
6
0
Are there any code examples left?
New code examples in category Shell/Bash
-
Shell/Bash 2022-03-27 22:30:33 wise highlight ubuntu
-
Shell/Bash 2022-03-27 22:25:19 how to send a pull request in git
-
Shell/Bash 2022-03-27 21:55:06 how to open terminal in sublime text ubuntu
-
Shell/Bash 2022-03-27 21:25:19 how to switch branch
-
Shell/Bash 2022-03-27 21:20:25 python
-
Shell/Bash 2022-03-27 21:20:04 set user as admin gitlab
-
Shell/Bash 2022-03-27 21:10:09 apache2 mod_jk proxy to tomcat connector
-
Shell/Bash 2022-03-27 20:35:12 chown
-
Shell/Bash 2022-03-27 20:15:08 awk last match