It is quite easy to install java sun jdk 1.6.x using xxx.rpm.bin installer from java.com, but it forces you to press "Enter" for the license agreement during installation. This is a problem for me as I need to create script to install java jdk automatically. Anyone know how to avoid this issue? Thanks.
2 Answers
The linux command "yes" can repeatedly press a key (default is y)
yes | ./jdk-6u24-linux-x64.bin
Pretty simple, If you want it to just hit <Enter>
do:
yes '' | ./jdk-6u24-linux-x64.bin
See more at http://www.computerhope.com/unix/yes.htm
I presume you already add executable attribute to the bin file:
echo | ./jdk-6u24-linux-x64.bin
Or if is expecting Y,y or yes:
echo y | ./jdk-6u24-linux-x64.bin
Now, just be patient and wait until the end.
-
While this will work if it is expecting one
<Enter>
ory
, if it is expecting more than one you will need to use a command likeyes
. Mar 25, 2011 at 18:43