1

I'm trying to automate Java SE install on my linux boxes (Fedora and Ubuntu) and while I can download the rpms/deb files, I cannot get it to install without the interactive license agreement. Is there a way to agree to license via command line without human interaction? Thanks in advance.

rdodev
  • 3,164
  • 3
  • 26
  • 34
  • flagged this for SuperUser, it belongs there. – kbyrd Nov 15 '11 at 22:05
  • possible duplicate of [Auto yes to the License Agreement on sudo apt-get -y install oracle-java7-installer](http://stackoverflow.com/questions/19275856/auto-yes-to-the-license-agreement-on-sudo-apt-get-y-install-oracle-java7-instal) – Ciro Santilli OurBigBook.com Jan 25 '15 at 22:04
  • 1
    If anything that one is a duplicate of this one, given the dates they were asked. – rdodev Jan 26 '15 at 01:40

2 Answers2

1

From Ubuntu Forums, try

DEBIAN_FRONTEND=noninteractive apt-get install -y java5-sun-jre || :
debconf 'echo SET shared/accepted-sun-dlj-v1-1 true; echo $(read) >&2'
apt-get install -y java6-sun-jre
Gordon
  • 1,844
  • 4
  • 17
  • 32
1

Note that Ubuntu ships with OpenJDK which does not require the "accept license" part. If that is good enough for you then just run

sudo apt-get install default-jdk

(for recent Ubuntus)

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • Hey Thorbjorn, I wish I could use open-jdk/jre. We have two third-party tools that require Oracle/Sun jre. – rdodev Nov 16 '11 at 14:24