Checkout fails after upgrade to JDK 21

I upgraded our project to JDK 21 and so I did with the CircleCI configuration. In particular I replaced cimg/openjdk:17.0.2 with cimg/openjdk:21.0.0. Since then the checkout step for the Java build job fails with the following error:

Directory (/home/circleci/project) you are trying to checkout to is not empty and not a git repository

Another job that builds some docs without any Java has no problem checking out the same directory.

What causes this issue? Is the JDK 21 image handling some things differently?

The failing job’s configuration:

    type: string
    default: cimg/openjdk:21.0.0

      - image: << pipeline.parameters.jdk-image >>
      - checkout
      - restore_cache:
          key: v1-gradle-cache-{{ checksum "build.gradle" }}
      - run:
          name: Run Build
          command: ./gradlew build -x test -i
      - save_cache:
            - ~/.gradle
          key: v1-gradle-cache-{{ checksum "build.gradle" }}

It seems that the builder of the cimg/openjdk:21.0.0 image has left a project directory with a mill bash file in it.

Until the team resolves this issue your best bet would be to just place

    - run: rm -R /home/circleci/project

before the checkout step so that the file is deleted.

Can you open a support ticket reporting this issue.

This works. Thanks. I’ll open a support ticket.

I’ve just re-run the test I built for this issue and it seems that there has been a new image published, that has removed the extra file from /home/circleci/project.