Search code examples
javapermalinks

Does Oracle have a permalink that always points to whatever is the latest version of JDK?


I am looking for a permalink pointing to the URL of the latest JDK version currently available at any given time. I want to include an option for my user to install the JDK if they don't have it when running my installation script.

(It needs to be the JDK as it is a dependency)

Going to java.com/en/download/ doesn't help me as those URLs are fixed to a version number.

Here is a sample of my current script:

#!/bin/bash

# Download Oracle Java 8 accepting the license
wget --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/8u112-b15/server-jre-8u112-linux-x64.tar.gz

Notice the URL is fixed to a specific version. I want to avoid that.


Solution

  • There's no permalink and the strategies to find out with workarounds changed over the years. See https://stackoverflow.com/a/14307459/131929 for details.

    Currently you could run curl -s https://java.com/en/download/installed8.jsp | grep latest8Version.