18
18
19
19
# Supported Java LTS versions mapped with Eclipse Temurin build semvers
20
20
JAVA_VERSIONS = {
21
- "8" : "8u422-b05 " ,
22
- "11" : "11.0.24+8 " ,
23
- "17" : "17.0.12+7 " ,
24
- "21" : "21.0.4+7 " ,
21
+ "8" : "8u432-b06 " ,
22
+ "11" : "11.0.25+9 " ,
23
+ "17" : "17.0.13+11 " ,
24
+ "21" : "21.0.5+11 " ,
25
25
}
26
26
27
27
@@ -77,6 +77,8 @@ def _get_install_marker_path(self, install_dir: str) -> str:
77
77
return os .path .join (install_dir , "bin" , "java" )
78
78
79
79
def _get_download_url (self ) -> str :
80
+ # Note: Eclipse Temurin does not provide Mac aarch64 Java 8 builds.
81
+ # See https://adoptium.net/en-GB/supported-platforms/
80
82
try :
81
83
LOG .debug ("Determining the latest Java build version" )
82
84
return self ._download_url_latest_release ()
@@ -113,8 +115,8 @@ def _post_process(self, target: InstallTarget) -> None:
113
115
"jdk.httpserver,jdk.management,jdk.management.agent,"
114
116
# Required by Spark and Hadoop
115
117
"java.security.jgss,jdk.security.auth,"
116
- # OpenSearch requires Thai locale for segmentation support
117
- "jdk.localedata --include-locales en,th "
118
+ # Include required locales
119
+ "jdk.localedata --include-locales en "
118
120
# Supplementary args
119
121
"--compress 2 --strip-debug --no-header-files --no-man-pages "
120
122
# Output directory
@@ -132,18 +134,22 @@ def get_java_home(self) -> str | None:
132
134
return self .get_installed_dir ()
133
135
134
136
@property
135
- def arch (self ) -> str :
137
+ def arch (self ) -> str | None :
136
138
return (
137
139
"x64" if get_arch () == Arch .amd64 else "aarch64" if get_arch () == Arch .arm64 else None
138
140
)
139
141
142
+ @property
143
+ def os_name (self ) -> str | None :
144
+ return "linux" if is_linux () else "mac" if is_mac_os () else None
145
+
140
146
def _download_url_latest_release (self ) -> str :
141
147
"""
142
148
Return the download URL for latest stable JDK build.
143
149
"""
144
150
endpoint = (
145
151
f"https://api.adoptium.net/v3/assets/latest/{ self .version } /hotspot?"
146
- f"os=linux &architecture={ self .arch } &image_type=jdk"
152
+ f"os={ self . os_name } &architecture={ self .arch } &image_type=jdk"
147
153
)
148
154
# Override user-agent because Adoptium API denies service to `requests` library
149
155
response = requests .get (endpoint , headers = {"user-agent" : USER_AGENT_STRING }).json ()
@@ -153,8 +159,6 @@ def _download_url_fallback(self) -> str:
153
159
"""
154
160
Return the download URL for pinned JDK build.
155
161
"""
156
- os = "linux" if is_linux () else "mac" if is_mac_os () else None
157
-
158
162
semver = JAVA_VERSIONS [self .version ]
159
163
tag_slug = f"jdk-{ semver } "
160
164
semver_safe = semver .replace ("+" , "_" )
@@ -166,7 +170,7 @@ def _download_url_fallback(self) -> str:
166
170
167
171
return (
168
172
f"https://github.com/adoptium/temurin{ self .version } -binaries/releases/download/{ tag_slug } /"
169
- f"OpenJDK{ self .version } U-jdk_{ self .arch } _{ os } _hotspot_{ semver_safe } .tar.gz"
173
+ f"OpenJDK{ self .version } U-jdk_{ self .arch } _{ self . os_name } _hotspot_{ semver_safe } .tar.gz"
170
174
)
171
175
172
176
0 commit comments