File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,6 +179,16 @@ def _build_python(work_dir: Path, branch: Optional[str]) -> list[str]:
179179def _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' ,
You can’t perform that action at this time.
0 commit comments