title: From command line download latest Java SE Runtime Environment 8 on Windows
body: <p>On a Windows server, I am looking for a robust way to download latest Java SE Runtimes from command-line .</p>
  
  <p>My requirement is to check if java is installed on the system.
  If java is not found, our MSI installer (created with WIX) need to connect oracle java download page and silently download java installer in the background and invoke the installer silently. 
  Download option can be in VB script/PowerShell/batch/Java</p>
  
  <p>Installing java silently is easy with <code>jre-8u121-windows-x64.exe /s</code>option.</p>
  
  <p>I could find couple of solutions to download jre on *nix with curl/wget
  <a href="https://stackoverflow.com/questions/10268583/downloading-java-jdk-on-linux-via-wget-is-shown-license-page-instead">from this post</a></p>
  
  <p>However, couldn't find any robust solution on Windows. </p>
  
  <p>Please let me know is there a fool proof way to download JRE installer on Windows from command line. </p>