The latest versions of Oracle JDK, available under the Oracle No-Fee Terms and Conditions License, and of Oracle GraalVM, available under the GraalVM Free Terms and Conditions, can be downloaded from a command line, or automatically in scripts and dockerfiles by using download URLs which will deliver the then-current update release.
For example, to retrieve the current JDK 22 update release for Linux x64 as a compressed (tar.gz) archive, you can use
the
wget
command:
wget https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz
GraalVM releases are also available using a similar URL with
graalvm
instead of
java
in the path and added to the filename.
For example, to get the current version of GraalVM for JDK 22, for Linux x64 as a compressed (tar.gz) archive, use:
wget https://download.oracle.com/graalvm/22/latest/graalvm-jdk-22_linux-x64_bin.tar.gz
curl
:
curl https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz
curl https://download.oracle.com/graalvm/22/latest/graalvm-jdk-22_linux-x64_bin.tar.gz
https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz.sha256
https://download.oracle.com/graalvm/22/latest/graalvm-jdk-22_linux-x64_bin.tar.gz.sha256
These URLs will deliver the initial releases of JDK 22 and of GraalVM for JDK 22 with their respective checksums until the release of JDK 22.0.1 in April of 2024. The URLs will then deliver 22.0.1 until the release of 22.0.2 in July of 2024, and will deliver 22.0.2 until JDK 22 reaches end of life in September of 2024 (when JDK 23 URLs will become available).
URLs for all JDK versions available under the Oracle No-Fee Terms and Conditions License and for GraalVM versions released under the GraalVM Free Terms and Conditions are supported.
There are several OS, architecture, and packaging options available. The following table lists them as they are spelled in the permanent URLs:
Operating Systems | Architecture | JDK Packaging Options | GraalVM Packaging Options |
---|---|---|---|
linux | aarch64 | rpm, tar.gz | tar.gz |
x64 | deb, rpm, tar.gz | tar.gz | |
macos | aarch64 | dmg, tar.gz | tar.gz |
x64 | dmg, tar.gz | tar.gz | |
windows | x64 | exe, msi, zip | zip |
For a complete list of scriptable JDK URLs visit https://www.oracle.com/javadownload
If rather than the latest update of a release you want to download a particular version, there are corresponding archive URLs that will start working on the day on which that version is released. The archive URLs use the full version number on the filename and have the word `archive`
instead of `latest`
in the path.
For example:
To download the GA version of JDK 22 you can use:
https://download.oracle.com/java/22/archive/jdk-22_linux-x64_bin.tar.gz
for JDK 21.0.2 you can use:
https://download.oracle.com/java/21/archive/jdk-21.0.2_linux-x64_bin.tar.gz
for the GA version of GraalVM for JDK 22 version use:
https://download.oracle.com/graalvm/22/archive/graalvm-jdk-22_linux-x64_bin.tar.gz
for GraalVM for JDK 17.0.9 version use:
https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.9_linux-x64_bin.tar.gz
for JDK 17.0.10 version use:
https://download.oracle.com/java/17/archive/jdk-17.0.10_linux-x64_bin.tar.gz
The archive releases also have corresponding archive URLs for the checksum.
For example, to retrieve the checksum for
jdk-17.0.8_linux-x64_bin.tar.gz
visit:
https://download.oracle.com/java/17/archive/jdk-17.0.8_linux-x64_bin.tar.gz.sha256
For example, to retrieve the checksum for
graalvm-jdk-17.0.10_linux-x64_bin.tar.gz
visit:
https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.10_linux-x64_bin.tar.gz.sha256
Here is a fraction of a sample docker file that will download the current JDK 21 version as a tar.gz, check the
download against it’s checksum, and extract it to
/usr/java/jdk-21
ENV JAVA_PKG=https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz \
JAVA_HOME=/usr/java/jdk-21
RUN set -eux; \
JAVA_SHA256=$(curl "$JAVA_PKG".sha256) ; \
curl --output /tmp/jdk.tgz"$JAVA_PKG" && \
echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1
The complete Dockerfile is available in Oracle’s docker image repository in GitHub. The container image created with this Dockerfile is available in the Oracle Container Registry.
The latest URLs will continue to work for as long as an up-to-date version of the JDK in question is available under the Oracle No-Fee Terms and Conditions License and an up-to-date version of GraalVM for that JDK is available under the GraalVM Free Terms and Conditions.
JDK 22 and GraalVM for JDK 22 latest URLs will work for six months after GA; up to the release of JDK 23 in September of 2024. They will cease to work on October of 2024, with the release of the first Critical Patch Update that does not include an update of JDK 22.
JDK 21 LTS and GraalVM for JDK 21 LTS latest URLs will work for three years after GA and one year after the next JDK LTS release is available. They will cease to work on October of 2026.
JDK 17 LTS and GraalVM for JDK 17 LTS latest URLs will work for three years after GA and one year after the next JDK LTS release is available. They will cease to work on October of 2024. Java SE Subscribers and customers using Oracle Cloud Infrastructure will be able to continue getting updates for JDK 17 and GraalVM for JDK 17; other users should migrate to the next LTS.
The archive URLs for each release will continue to work for at least a year after the corresponding latest URLs stop being available.