Skip to main content
View SourceRelease Notes

Install Oracle JDK

This folder contains a script for installing the Oracle JDK. The main reason to use the Oracle JDK instead of OpenJDK is that Oracle provides commercial support for the Oracle JDK. The Oracle JDK may also offer better performance and certain libraries not available in the OpenJDK, though the differences between the two JDKs have gotten smaller over the last few years.

This script has been tested on the following operating systems:

  • Amazon Linux
  • Ubuntu

There is a good chance it will work on Debian, CentOS, and RHEL as well, but our automated testing for this module does not cover these other distros at the moment.

Quick start

The easiest way to use this module is with the Gruntwork Installer:

gruntwork-install \
--module-name "install-oracle-jdk" \
--repo "https://github.com/gruntwork-io/terraform-aws-zookeeper" \
--tag "v0.2.0"

We recommend running this module as part of a Packer template to create an Amazon Machine Image (AMI) (see the zookeeper-ami example for a fully-working sample code).

Command line Arguments

The install-oracle-jdk module accepts the following arguments, all optional:

  • --download-url: The URL to download the JDK RPM installer from the Oracle website.
  • --checksum: The sha256 checksum from the Oracle website for the file at --download-url.

Note that this script will automatically detect whether you are running an apt-based system like Debian/Ubuntu, or a yum-based system like RHEL, CentOS, or Amazon Linux.

If you're using gruntwork-install to run this module, you can pass these arguments using --module-param arguments. Example:

gruntwork-install \
--module-name "install-oracle-jdk" \
--repo "https://github.com/gruntwork-io/terraform-aws-zookeeper" \
--tag "v0.2.0" \
--module-param "download-url=http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz" \
--module-param "checksum=68ec82d47fd9c2b8eb84225b6db398a72008285fafc98631b1ff8d2229680257"