Automate Java installs on Unix Automate Java installs on Unix unix unix

Automate Java installs on Unix


The installer scripts may vary on each platform but on Linux, there are 3 hurdles you need to overcome:

  • Spacing through the long EULA
  • Entering "yes" to accept the EULA
  • Pressing Enter after the install is done.

You can get away with this by echoing yes and a newline in to the script while redirecting stdout to /dev/null so that the EULA isn't printed:

echo "yes" "\n" | ./jdk-6u16-linux-i586.bin 1>/dev/null

You may have to tweak this on Solaris


Would you not consider using the 'expect' script to do that...instead of doing it the awkward way, the script will simply enter a 'Yes' when it comes to the agreement page...the download link is here. Effectively a wrapper using expect containing the package...

Hope this helps,Best regards,Tom.


Have a look at how Hudson does it. It can dynamically download and install at least Java 1.4, 5 and 6 from Sun in the background.