aws-codebuild-docker-images icon indicating copy to clipboard operation
aws-codebuild-docker-images copied to clipboard

Cannot use Java 17 windows-base:2019-2.0 with corretto17 runtime.

Open cg-manish opened this issue 3 years ago • 0 comments

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:

  1. create a Codebuild project with, windows-base:2019-2.0 as the build image.
  2. Add java --version command 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.

cg-manish avatar Aug 15 '22 05:08 cg-manish