Skip to content

Commit

Permalink
Remove Java 11 support (#457)
Browse files Browse the repository at this point in the history
* Accept case insensitive location in HTTP response

* Remove Java 11 support

Jenkins weekly 2.463 dropped support for Java 11.  Jenkins LTS 2.479.1
will drop support for Java 11 when it releases 30 Oct 2024.

The Jenkins security team only provides security fixes for the most recent
weekly release and the most recent LTS release.  That means there will
be no security updates for Jenkins LTS versions prior to 2.479.1 once
it is released 30 Oct 2024.

Jenkins agents require a JDK that has the same major version as the
controller or a greater JDK major version than the controller JVM.
After 30 Oct 2024, there will be no supported configuration where Java
11 agents run.  This change removes the Java 11 build and update process.

We can wait until 30 Oct 2024 to merge this change if needed, but there
is not much reason to wait beyond 30 Oct 2024 for that merge.
  • Loading branch information
MarkEWaite authored Oct 12, 2024
1 parent 4c0d4f0 commit d4baced
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 130 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bake_base_cli := docker buildx bake --file docker-bake.hcl
bake_cli := $(bake_base_cli) --load

.PHONY: build
.PHONY: test test-alpine test-archlinux test-debian test-jdk11 test-jdk11-alpine
.PHONY: test test-alpine test-debian

check-reqs:
## Build requirements
Expand Down
8 changes: 3 additions & 5 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ RUN apk add --no-cache \
ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"

RUN case "$(jlink --version 2>&1)" in \
# jlink version 11 has less features than JDK17+
"11."*) set -- "--strip-debug" "--compress=2" ;; \
"17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \
"17."*) set -- "--compress=2" ;; \
# the compression argument is different for JDK21
"21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \
"21."*) set -- "--compress=zip-6" ;; \
*) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \
esac; \
jlink \
--strip-java-debug-attributes \
"$1" \
"$2" \
--add-modules ALL-MODULE-PATH \
--no-man-pages \
--no-header-files \
Expand Down
8 changes: 3 additions & 5 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,14 @@ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
RUN case "$(jlink --version 2>&1)" in \
# jlink version 11 has less features than JDK17+
"11."*) set -- "--strip-debug" "--compress=2" ;; \
"17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \
"17."*) set -- "--compress=2" ;; \
# the compression argument is different for JDK21
"21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \
"21."*) set -- "--compress=zip-6" ;; \
*) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \
esac; \
jlink \
--strip-java-debug-attributes \
"$1" \
"$2" \
--add-modules ALL-MODULE-PATH \
--no-man-pages \
--no-header-files \
Expand Down
13 changes: 3 additions & 10 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ group "linux-arm64" {

group "linux-s390x" {
targets = [
"debian_jdk11",
"debian_jdk21"
]
}
Expand All @@ -33,7 +32,7 @@ group "linux-ppc64le" {
}

variable "jdks_to_build" {
default = [11, 17, 21]
default = [17, 21]
}

variable "default_jdk" {
Expand Down Expand Up @@ -64,10 +63,6 @@ variable "ALPINE_SHORT_TAG" {
default = regex_replace(ALPINE_FULL_TAG, "\\.\\d+$", "")
}

variable "JAVA11_VERSION" {
default = "11.0.24_8"
}

variable "JAVA17_VERSION" {
default = "17.0.12_7"
}
Expand Down Expand Up @@ -95,11 +90,9 @@ function "is_default_jdk" {
# Return the complete Java version corresponding to the jdk passed as parameter
function "javaversion" {
params = [jdk]
result = (equal(11, jdk)
? "${JAVA11_VERSION}"
: (equal(17, jdk)
result = (equal(17, jdk)
? "${JAVA17_VERSION}"
: "${JAVA21_VERSION}"))
: "${JAVA21_VERSION}")
}

## Specific functions
Expand Down
6 changes: 3 additions & 3 deletions jdk-download-url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ for ARCH in $ARCHS; do
URL="https://api.adoptium.net/v3/binary/version/jdk-${ENCODED_ARCHIVE_DIRECTORY}/${OS_TYPE}/${ARCH}/jdk/hotspot/normal/eclipse?project=jdk"

if ! RESPONSE=$(curl -fsI "$URL"); then
echo "Error: Failed to fetch the URL for architecture ${ARCH}. Exiting with status 1." >&2
echo "Error: Failed to fetch the URL for architecture ${ARCH} from ${URL}. Exiting with status 1." >&2
echo "Response: $RESPONSE" >&2
exit 1
fi

# Extract the redirect URL from the HTTP response
REDIRECTED_URL=$(echo "$RESPONSE" | grep Location | awk '{print $2}' | tr -d '\r')
REDIRECTED_URL=$(echo "$RESPONSE" | grep -i location | awk '{print $2}' | tr -d '\r')

# If no redirect URL was found, exit the script with an error message
if [ -z "$REDIRECTED_URL" ]; then
echo "Error: No redirect URL found for architecture ${ARCH}. Exiting with status 1." >&2
echo "Error: No redirect URL found for architecture ${ARCH} from ${URL}. Exiting with status 1." >&2
echo "Response: $RESPONSE" >&2
exit 1
fi
Expand Down
21 changes: 0 additions & 21 deletions updatecli/scripts/check-jdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,10 @@ function get_jdk_download_url() {
jdk_version="${1}"
platform="${2}"
case "${jdk_version}" in
8*)
## JDK8 does not have the carret ('-') in their archive names
echo "https://github.com/adoptium/temurin8-binaries/releases/download/jdk${jdk_version}/OpenJDK8U-jdk_${platform}_hotspot_${jdk_version//-}";
return 0;;
11*)
## JDK11 URLs have an underscore ('_') instead of a plus ('+') in their archive names
echo "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${jdk_version}/OpenJDK11U-jdk_${platform}_hotspot_${jdk_version//+/_}";
return 0;;
17*)
## JDK17 URLs have an underscore ('_') instead of a plus ('+') in their archive names
echo "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-${jdk_version}/OpenJDK17U-jdk_${platform}_hotspot_${jdk_version//+/_}";
return 0;;
19*)
## JDK19 URLs have an underscore ('_') instead of a plus ('+') in their archive names
echo "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-${jdk_version}/OpenJDK19U-jdk_${platform}_hotspot_${jdk_version//+/_}";
return 0;;
21*)
## JDK21 URLs have an underscore ('_') instead of a plus ('+') in their archive names
echo "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-${jdk_version}/OpenJDK21U-jdk_${platform}_hotspot_${jdk_version//+/_}";
Expand All @@ -40,17 +28,8 @@ function get_jdk_download_url() {
}

case "${1}" in
8u*)
# No s390x support for JDK8: $platforms is kept as default
platforms=("x64_linux" "x64_windows" "aarch64_linux");;
11.*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
17.*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
19.*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
21*+*-ea-beta)
platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");;
21*+*)
platforms=("x64_linux" "x64_windows" "aarch64_linux");;
*)
Expand Down
84 changes: 0 additions & 84 deletions updatecli/updatecli.d/jdk11.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion updatecli/values.temurin.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
temurin:
version_pattern: "^jdk-[11|17|21].(\\d*).(\\d*).(\\d*)(.(\\d*))\\+(\\d*)?$"
version_pattern: "^jdk-[17|21].(\\d*).(\\d*).(\\d*)(.(\\d*))\\+(\\d*)?$"

0 comments on commit d4baced

Please sign in to comment.