java – How to automatically install Java JDK in a specific directory on Windows

On my development computer I always have to install Java 6 And Java 7 and I have to install each JDK in both, the 32 and 64 bit version, for testing purposes. Since the frequency of Java updates seems to be getting more and more ridiculous (twice a week now?) Each update requires you to cancel and then reinstall 4 JDK. So this is getting really quite annoying and I would like to then write the whole process.

My problem is that by default each version of JDK installs in a directory path that contains the update number (default: “C: \ Program Files \ Java \ jdk1.6.0_ \”). To avoid having to adapt tons of build scripts, I always manually strip “_ ” in the installation path and always install in the same “C: \ Program Files \ Java \ jdk1.6.0” or “C: \ Program Files \ Java \ jdk1.7.0 “, resp., For 64-bit versions and in C: \ Program Files (x86) \ Java \ jdk1.6.0” or “C: \ Program Files (x86) \ Java \ jdk1.7.0”, resp ., For 32-bit versions.

As I found out, how to specify the installation directory for a JRE installer (i.e. Java runtime):

.exe [/s] [INSTALLDIR=:\] 
    [STATIC=1] [WEB_Java=0/1] [WEB_Java_SECURITY_LEVEL=VH/H/M/L]

I still haven’t found a similar description of how to specify the installation directory for the JDK installer.

Does anyone know if and how you can specify the installation path for the JDK installer, so that a silent JDK installation can be directed to a specific installation directory?

Leave a comment