Skip to content

Commit 2d08a27

Browse files
authored
add java 24 support in java installer for trino (#12963)
1 parent f272f47 commit 2d08a27

File tree

1 file changed

+37
-10
lines changed
  • localstack-core/localstack/packages

1 file changed

+37
-10
lines changed

localstack-core/localstack/packages/java.py

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"11": "11.0.25+9",
2323
"17": "17.0.13+11",
2424
"21": "21.0.5+11",
25+
"24": "24.0.1+9",
2526
}
2627

2728

@@ -114,23 +115,49 @@ def _post_process(self, target: InstallTarget) -> None:
114115

115116
# Build a custom JRE with only the necessary bits to minimise disk footprint
116117
LOG.debug("Optimising JRE installation")
117-
cmd = (
118-
"bin/jlink --add-modules "
118+
119+
base_modules = [
119120
# Required modules
120-
"java.base,java.desktop,java.instrument,java.management,"
121-
"java.naming,java.scripting,java.sql,java.xml,jdk.compiler,"
121+
"java.base",
122+
"java.desktop",
123+
"java.instrument",
124+
"java.management",
125+
"java.naming",
126+
"java.scripting",
127+
"java.sql",
128+
"java.xml",
129+
"jdk.compiler",
122130
# jdk.unsupported contains sun.misc.Unsafe which is required by some dependencies
123-
"jdk.unsupported,"
131+
"jdk.unsupported",
124132
# Additional cipher suites
125-
"jdk.crypto.cryptoki,"
133+
"jdk.crypto.cryptoki",
126134
# Archive support
127-
"jdk.zipfs,"
135+
"jdk.zipfs",
128136
# Required by MQ broker
129-
"jdk.httpserver,jdk.management,jdk.management.agent,"
137+
"jdk.httpserver",
138+
"jdk.management",
139+
"jdk.management.agent",
130140
# Required by Spark and Hadoop
131-
"java.security.jgss,jdk.security.auth,"
141+
"java.security.jgss",
142+
"jdk.security.auth",
143+
# Include required locales
144+
"jdk.localedata",
145+
]
146+
147+
# Add version-specific modules, not all versions require/support the same set
148+
version_specific_modules = {
149+
"24": ["jdk.incubator.vector"], # Required for Trino latest version
150+
}
151+
152+
modules = base_modules + version_specific_modules.get(self.version, [])
153+
modules_str = ",".join(modules)
154+
155+
cmd = (
156+
"bin/jlink "
157+
# Add modules
158+
f"--add-modules {modules_str} "
132159
# Include required locales
133-
"jdk.localedata --include-locales en "
160+
"--include-locales en "
134161
# Supplementary args
135162
"--compress 2 --strip-debug --no-header-files --no-man-pages "
136163
# Output directory

0 commit comments

Comments
 (0)