SDKMAN 5.5.9+231 says package is not a valid candidate on MacOS

随声附和 提交于 2021-01-04 04:15:34

问题


I have no idea why this started happening, but my SDKMAN stopped working and only displays the following message for whatever package I want to list, install, or use.

$ sdk list java

Stop! java is not a valid candidate.

$ sdk install java

Stop! java is not a valid candidate.

$ sdk use java 8u131

Stop! java is not a valid candidate.

Just typing sdk list works, though. But I can't do anything. My .bash_profile contains the following:

export JAVA_HOME=$(/usr/libexec/java_home)

export SDKMAN_DIR="/Users/myusername/.sdkman"
[[ -s "/Users/myusername/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/myusername/.sdkman/bin/sdkman-init.sh"

回答1:


Also double check if you put the target sdk in front of the version. This won't work:

sdk install 9.0.4-openjdk

Stop! 9.0.4-openjdk is not a valid candidate.

Specifying it correctly works:

sdk install java 9.0.4-openjdk



回答2:


The problem was on the server side. Something to do with SDKMAN's Candidates API. As pointed out in the GitHub issue, you can get over the problem using the following command:

sdk flush candidates

Make sure to restart your terminal after that.



来源:https://stackoverflow.com/questions/44507424/sdkman-5-5-9231-says-package-is-not-a-valid-candidate-on-macos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!