title: Installing JDK 8 and JRE 8 silently on a Windows machine through command line
body: <p>We want to update the JDK environment on multiple machines, all running windows but different versions (either XP or 7)</p>
  
  <p>For that purpose, I'm now creating a script which will automatically run the correct installer (32/64 bit).
  I tried running the installer with the following command:</p>
  
  <p><code>jdk-8u25-windows-x64.exe /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature"</code></p>
  
  <p>This works fine on a machine with no JDK/JRE 8 installed. However, I am running into a few issues:</p>
  
  <ul>
  <li>If JDK/JRE 8 is already installed, the installer UNINSTALLS both JDK &amp; JRE instead of simply not doing anything (or re-installing)</li>
  <li>If a reboot is required it is forcefully performed automatically, and I need to avoid that as there are other actions I need to perform in the script after the installation completes.</li>
  <li>There is no VERBOSE mode / log file to indicate what the installer is actually doing</li>
  </ul>
  
  <p>I have looked at these sources:</p>
  
  <ul>
  <li><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_jdk_install.html#CHDHHBDD">JDK Installation for Microsoft Windows - Installing the JDK Silently</a></li>
  <li><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_installer_options.html#CJAJGEHA">Windows JRE Installer Options - Command-Line Installation</a></li>
  </ul>
  
  <p>but they seem lacking and very confusing as to what will give me the wanted result.</p>