aws-codebuild-docker-images
aws-codebuild-docker-images copied to clipboard
Cannot use Java 17 windows-base:2019-2.0 with corretto17 runtime.
Describe the bug Cannot use java 17 in windows-base:2019-2.0 because java 11 is installed by default even after setting java runtime version to corretto17.
phases:
install:
runtime-versions:
java: corretto17
To Reproduce Steps to reproduce the behavior:
- create a Codebuild project with, windows-base:2019-2.0 as the build image.
- Add
java --versioncommand in one of the steps in buildspec.yaml as :
pre_build:
commands:
- java --version
- echo $env:Path
- echo $env:JAVA_HOME
Expected behavior The java version should be 17.
Logs If applicable, add log output to help explain your problem.
Output of java --version command:
openjdk 11.0.15 2022-04-19 LTS
--
24 | OpenJDK Runtime Environment Corretto-11.0.15.9.1 (build 11.0.15+9-LTS)
25 | OpenJDK 64-Bit Server VM Corretto-11.0.15.9.1 (build 11.0.15+9-LTS, mixed mode)
Output of $env:JAVA_HOME:
C:\Program Files\Amazon Corretto\jdk11.0.15_9
Platform (please complete the following information):
- OS: Windows server 2019
Additional context: I am using Java 17 because jpacakge is not available in Java 11.