Installing the JDK unattended

From SarahWiki

Installing the JDK unattended is relatively straightforward as a consequence of the installer being built on top of the Windows Installer standard (MSI).

In practice, the exact syntax of the command line is extremely critical. In particular, it is essential that you don't include a space between the /v and the double-quote. A usable example command is as follows:

 jdk-1_5_0_05-windows-i586-p.exe /s /v"/qn ADDLOCAL=ALL INSTALLDIR=c:\myjdkdir"

This installs everything, and is completely silent -- not even the license agreement pops up.

Notes

  1. There seems to be a weird problem running the installer from cygwin, but a usable workaround is to use echo to write a one-liner batch file containing the necessary command, then execute the batch file with cmd /c mybatchfile.bat or some such.