title: How to automate download and installation of Java JDK on Linux TODAY?
body: <p>There is this lovely answer on how to automate the download of the Java JDK on Linux:
  <a href="https://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux">Downloading Java JDK on Linux via wget is shown license page instead</a></p>
  
  <p>The method described no longer works.  It seems Oracle has once again changed the restrictions on their download servers to block this method.  I suppose they do not want Java to be used in autoscaling server systems like AWS.  <em>What are they thinking?</em></p>
  
  <p>The specific command I am trying is to download the latest 7u51 version to an AWS server so I can install my web applications:</p>
  
  <pre><code>wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2%2Fwww.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm"
  </code></pre>
  
  <p>This no longer gets around the OTN license agreement as noted in this closed answer:
  <a href="https://stackoverflow.com/a/21431491/2144836">https://stackoverflow.com/a/21431491/2144836</a></p>
  
  <p>Trying this from my browser, I see the download link is adding an additional authentication in a query parameter:</p>
  
  <pre><code>http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm?AuthParam=1392853518_cb83fe47e04500eecccdb66722756fb3
  </code></pre>
  
  <p>Copying and pasting this link with the AuthParam into the <code>wget</code> call does not work either.  My initial guess is that it is tied to a session or IP address.</p>
  
  <p>It is not reasonable to try downloading this manually to a server (or to a hundred servers a hundred times a day), so I am hoping for a workaround that will work with the current restrictions.</p>
  
  <p>So TODAY, is there a workaround for automating the download of the latest JDK?  Or should I just give up on Oracle entirely?</p>