Skip to content

Commit 80e0927

Browse files
committed
use java 22 to build
1 parent e8d50bd commit 80e0927

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

scripts/utils/build.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,16 @@ def _build_python(work_dir: Path, branch: Optional[str]) -> list[str]:
179179
def _build_java(work_dir: Path, branch: Optional[str]) -> list[str]:
180180
"""build s3-benchrunner-java"""
181181

182+
# Ensure Java 22 is used when available.
183+
# The FFM (Foreign Function & Memory) API requires Java 22+.
184+
# On Amazon Linux 2023, java-22-amazon-corretto-devel installs to this path
185+
# but may not be the default JAVA_HOME (the system default is often Java 17).
186+
java22_home = Path('/usr/lib/jvm/java-22-amazon-corretto')
187+
if java22_home.exists():
188+
print(f"Using Java 22 from {java22_home}")
189+
os.environ['JAVA_HOME'] = str(java22_home)
190+
os.environ['PATH'] = str(java22_home / 'bin') + ':' + os.environ.get('PATH', '')
191+
182192
# fetch latest aws-crt-java and install 1.0.0-SNAPSHOT
183193
awscrt_src = work_dir/'aws-crt-java'
184194
fetch_git_repo(url='https://github.com/awslabs/aws-crt-java.git',

0 commit comments

Comments
 (0)