Skip to content

Commit

Permalink
Merge pull request #66 from heroku/malax/openjdk16
Browse files Browse the repository at this point in the history
Add support for Java 16
  • Loading branch information
Malax authored Mar 17, 2021
2 parents 6e9738f + 98963b5 commit 45a0908
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions buildpacks/jvm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
* Support for Java 16

## [0.1.4] 2021/02/23

Expand Down
5 changes: 4 additions & 1 deletion buildpacks/jvm/lib/jvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DEFAULT_JDK_12_VERSION="12.0.2"
DEFAULT_JDK_13_VERSION="13.0.6"
DEFAULT_JDK_14_VERSION="14.0.2"
DEFAULT_JDK_15_VERSION="15.0.2"
DEFAULT_JDK_16_VERSION="16.0.0"

if [[ -n "${JDK_BASE_URL}" ]]; then
# Support for setting JDK_BASE_URL had the issue that it has to contain the stack name. This makes it hard to
Expand Down Expand Up @@ -67,6 +68,8 @@ get_full_jdk_version() {
echo "$DEFAULT_JDK_14_VERSION"
elif [ "${jdkVersion}" = "15" ]; then
echo "$DEFAULT_JDK_15_VERSION"
elif [ "${jdkVersion}" = "16" ]; then
echo "$DEFAULT_JDK_16_VERSION"
elif [ "$(expr "${jdkVersion}" : '^1.[6-9]$')" != 0 ]; then
local minorJdkVersion
minorJdkVersion=$(expr "${jdkVersion}" : '1.\([6-9]\)')
Expand All @@ -87,7 +90,7 @@ get_jdk_url() {
jdkVersion="$(get_full_jdk_version "${shortJdkVersion}")"

local jdkUrl
if [ "$(expr "${jdkVersion}" : '^1[0-5]')" != 0 ]; then
if [ "$(expr "${jdkVersion}" : '^1[0-9]')" != 0 ]; then
jdkUrl="${JDK_BASE_URL}/openjdk${jdkVersion}.tar.gz"
elif [ "$(expr "${jdkVersion}" : '^1.[6-9]')" != 0 ]; then
jdkUrl="${JDK_BASE_URL}/openjdk${jdkVersion}.tar.gz"
Expand Down

0 comments on commit 45a0908

Please sign in to comment.