Skip to content

SdkMan per-shell settings do not work #188

@gnodet

Description

@gnodet

Describe the bug
SdkMan provides a simple way to switch between various versions of some programs. The settings can be global or per-shell. The per-shell settings seems to be lost of the command is executed.

To Reproduce
Steps to reproduce the behavior:

  1. Install SDK:
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
  1. Install two different versions of maven
sdk install maven 3.8.8
sdk install maven 3.9.6
  1. Use 3.9.6 as the default
sdk default maven 3.9.6
  1. Verify selecting a different version in the current the shell
(sdk use maven 3.8.5 && mvn -v)

The output contains Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
5. Verify selecting a different version which should persist

sdk use maven 3.8.5 

and later

mvn -v

The output contains Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Expected behavior
The sdkman shell settings should be persisted in the session.

Analysis
It seems that SdkMan directly changes the PATH variable to point to the correct tool version, see https://github.com/sdkman/sdkman-cli/blob/master/src/main/bash/sdkman-use.sh#L49

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglegacyIssue pertaining to WaveLegacy

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions