-
-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Labels
Description
Bug report
After switching Java versions with sdk use, SDKMAN prints that the new version is active, but sdk current still shows the old version. However, which java confirms the new version is actually in use. This causes inconsistent reporting of the active candidate.
To reproduce
- Run
sdk currentand observe the currently active candidates. - Execute
sdk use java 21.0.2-open - Observe the message: "Using java version 21.0.2-open in this shell."
- Run
sdk currentagain — it still shows java 17.0.17-tem instead of the newly selected version. - Run
which java— it correctly points to the Java 21.0.2-open binary.
$ sdk current
Current versions in use:
java 17.0.17-tem
$ sdk use java 21.0.2-open
Using java version 21.0.2-open in this shell.
$ sdk current
Current versions in use:
java 17.0.17-tem
$ which java
/home/user/.sdkman/candidates/java/21.0.2-open/bin/java
Expected behavior:
sdk current should reflect the version selected by sdk use for the current shell session.
System info
$ lsb_release -a
Description: Ubuntu 22.04.5 LTS
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
$ sdk version
SDKMAN!
script: 5.20.0
native: 0.7.14 (linux x86_64)