Automate Java installation on Unix

I'm currently working on self-tuning / configuring deployments for J2EE applications. My goal is to set up a deployment of Java, App Server, and application deployments every time. Unfortunately, I am facing problems automating the installation of java.

A java installation is provided as a self-extracting binary (e.g. jre-6u18-solaris-sparc.sh). The problem is when you run it, you will be asked to read the license agreement, and then enter yes / no.

In an attempt to automate, I decided that I would simply unzip the file using "unzip" and it would expand, but something should either go wrong or skip some of the steps that occur when the self-extracting file is executed. When I go to run java, it complains that the libraries are missing or other error messages.

Currently, we plan to work and download and install manually, then update the extracted content and place the modified distribution inside. Not perfect b / c. I no longer work with the source distribution from SUN.

+7
java unix install
source share
3 answers

Installer scripts may vary on each platform, but on Linux there are three obstacles you need to overcome:

  • Interval between long EULA
  • Entering yes to accept EULA
  • Press Enter after installation is complete.

You can get away from this by repeating yes and a new line in the script by redirecting stdout to /dev/null so that EULA is not printed:

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

You may need to configure it on Solaris

+5
source share

Could you use expect 'script to do this ... instead of doing it awkwardly, the script will just type "Yes" when it comes to the agreement page ... the download link is here . Effectively a wrapper using wait containing a package ...

Hope this helps, Regards, Tom.

+1
source share

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

0
source share

All Articles