Sdkman-cli: Bug: Path separator omitted on use command

Created on 13 Oct 2020  路  3Comments  路  Source: sdkman/sdkman-cli

Bug report
Some elements of PATH are not correctly separated by sdkman.

To reproduce

  • start a bash shell
  • type sdk use java 11.0.8-zulu
  • type which java - output is for the default java command in /usr/bin/java
  • type echo $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

  • Linux leopard 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
  • SDKMAN 5.9.1+575
bug

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EarthCitizen picture EarthCitizen  路  3Comments

ilopmar picture ilopmar  路  5Comments

dayja78 picture dayja78  路  6Comments

OmidTahouri picture OmidTahouri  路  7Comments

WizardMerlin picture WizardMerlin  路  3Comments