Bug report
Some elements of PATH are not correctly separated by sdkman.
To reproduce
sdk use java 11.0.8-zuluwhich java - output is for the default java command in /usr/bin/javaecho $PATH - observe the lack of path separator between sdkman elements:/home/me/.nvm/versions/node/v11.7.0/bin:/home/me/.sdkman/candidates/maven/current/bin:/home/me/.sdkman/candidates/kscript/current/bin:/home/me/.sdkman/candidates/kotlin/current/bin:/home/me/.sdkman/candidates/java/11.0.8-zulu/home/me/.sdkman/candidates/gradle/current/bin:.:System info
Hi @ncowles,
thanks for reporting.
What's strange is that you have the following entry in your PATH
/home/me/.sdkman/candidates/java/11.0.8-zulu
That should actually be
/home/me/.sdkman/candidates/java/current/bin
What is your console output for readlink -f /home/me/.sdkman/candidates/java/current?
Hi @ncowles, I've just tried this on my side but not seeing this problem. Here is some console output:
$ alias path
path='echo $PATH | tr ":", "\n"'
$ path
<snip>
/home/marco/.sdkman/candidates/jbake/current/bin
/home/marco/.sdkman/candidates/java/11.0.8.hs-adpt/bin
/home/marco/.sdkman/candidates/http4k/current/bin
<snip>
Can I ask you to do a similar dump both before _and_ after issuing the sdk use command?
@helpermethod this behaviour is expected when the use command is invoked. It rewrites the path and replaces the current reference with the specific version that you choose to use in the current shell alone. This is what allows the use of multiple shells with different versions. Let's see if the path is in a bad state prior to the use command is being issued.
Thanks for responding guys, and thanks even more for building sdkman - it's a HUGE help to me every day.
I ran the commands suggested, and I am unable to reproduce in a fresh bash. The shell where this was occurring consistently was closed, so I can't tell what led to it.