Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install jre in a non interactive script

Tags:

java

bash

jvm

I want to install jre 1.7 in a non interactive script. is there a way to do that in equivalent of the following?

update-alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jre1.7/bin/java
like image 837
user3324120 Avatar asked Mar 09 '14 06:03

user3324120


1 Answers

Have a look at man update-alternatives. This reads:

   --set name path
          Set  the  program  path  as alternative for name.
          This is equivalent to --config but is non-interactive
          and thus scriptable.
like image 142
michas Avatar answered Nov 06 '22 10:11

michas