Skip to content

Prevent installing an already installed Java version

Catalin Irimie requested to merge cat-fix-java-install-exitcode into master

What does this MR do?

SDKMAN introduced a breaking change in 5.3.4 where it now exits with exit code 1 when trying to install a version that's already installed. We were relying on this by chaining the source && install && default commands, but now it fails and doesn't get to default anymore, thus not setting the proper Java version.

P.S: I did some basic tests on this branch for the following:

  1. Java 11 - successful job
  2. Java 8 - successful job
  3. Invalid Java version - successful job with the invalid warning and fallback to 8

What are the relevant issue numbers?

gitlab-org/gitlab#205696 (closed)

Does this MR meet the acceptance criteria?

Edited by Catalin Irimie

Merge request reports