1

During the install I have to hit [ENTER] in order for the install to proceed on the command:

apt-get install openjdk-7-jre

Is there a way to avoid this prompt?

PascalVKooten
  • 236
  • 2
  • 13

3 Answers3

2

Old question but still not answered and relevant. You need to install the headless package instead. At the time of this writing version 11 is out so I am using that as example:

apt install -y openjdk-11-jre-headless

or for JDK

apt install -y openjdk-11-jdk-headless
0

Easy way to do this

apt update
apt upgrade 
apt install -y openjdk-11-jdk-headless
java -version 

enter image description here

willie
  • 109
0

You can add the -y option i.e. apt-get -y install openjdk-7-jre

from the apt-get manual:

-y, --yes, --assume-yes Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package, trying to install a unauthenticated package or removing an essential package occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.

Edit: To accept the java license, the solution is here:

Installing Java Automatically (With Silent Option)

mosin
  • 1
  • That doesn't work for that one, the prompt you ask for is from apt-get. It's during the installation that something pop ups. – PascalVKooten Feb 14 '16 at 20:29