[JAVA] Install Oracle JDK 7, 8, etc via Ubuntu installer, skipping interaction

If you install using oracle-java * -installer, you will be asked for a licensing dialogue during the installation, which you may have experienced.

However, this is inconvenient if you want to proceed with the setup without interaction with a mechanism like CI or Infrastructure as Code.

I tried google, but it took some time to get a hit, so I'll make a note here. By issuing the following command, you can proceed with the installation by <OK> the license agreement without any interaction.

$ sudo add-apt-repository -y ppa:webupd8team/java
$ sudo apt-get update
$ echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-$ set-selections
$ echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
$ # sudo apt-get -y install oracle-java7-installer
$ sudo apt-get -y install oracle-java8-installer

Below are the Stackoverflow topics we arrived at. https://stackoverflow.com/questions/19275856/auto-yes-to-the-license-agreement-on-sudo-apt-get-y-install-oracle-java7-instal

In addition, let's confirm the license permission for the skipped dialogue separately. http://www.oracle.com/technetwork/jp/licenses/javase-dev-license-2595998-ja.html

Recommended Posts

Install Oracle JDK 7, 8, etc via Ubuntu installer, skipping interaction
Install Oracle JDK 8 via PPA in AWS Ubuntu Server 16.04
How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?
Install Oracle JDK 8 with Ansible
Install JDK and JRE on Ubuntu 16.10