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?

3 Answers 3

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

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)

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. Feb 14, 2016 at 20:29
0

Easy way to do this

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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .