-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incorrect JAVA_HOME for custom Corretto runtime on AL 2023 x86_64 #738
Comments
If the workaround is an acceptable fix, I'm willing to create a PR for this change. |
This happened today for me on a I'm going to file a support case as well to raise visibility. At least for me it appeared that JAVA_8_HOME and JAVA_11_HOME were defined correctly with the trailing .$arch but there was no definition of JAVA_17_HOME or JAVA_21_HOME to handle the supported runtimes, to say nothing of the original poster's case of custom runtimes. |
This got more interesting, it didn't match on
|
I was not able to reproduce the reported issue for the
|
For the other (main) issue, I was able to reproduce that the corretto22 install path differs from other versions when installed as a custom runtime version. We are working on a fix and will update here when it is released. |
I just retested and couldn't reproduce the issue as well, thank you for the confirmation though and good luck on the other fix. |
This was fixed in edad5c3 and is released in the latest image versions. |
Describe the bug
When I provision a CodeBuild project with Amazon Linux 2023 x86_64 standard:5.0, and set the runtime as
corretto22
in theinstall
phase, the exportedJAVA_HOME
,JRE_HOME
, andJDK_HOME
variables don't point to the correct installed location of Corretto 22, causing failure when I try to runmvn package
in the next phases.To Reproduce
Steps to reproduce the behavior:
pom.xml
)corretto22
as the runtime versionbuild
phase. Maven complains thatJAVA_HOME
is not set correctly.Expected behavior
The commands in
build
phase should pass and Maven should not complain aboutJAVA_HOME
Logs
NA
Platform (please complete the following information):
Additional context
The issue seems to stem from here.
In the above runtime configuration,
JAVA_HOME
,JRE_HOME
, andJDK_HOME
are all pointing to"/usr/lib/jvm/java-$VERSION-amazon-corretto"
whereas Corretto 22 installs at"/usr/lib/jvm/java-$VERSION-amazon-corretto.x86_64"
.Current workaround
Manually overriding the environment variables to point to correct location of Corretto 22 fixes the issue and things start working.
The text was updated successfully, but these errors were encountered: