Closed gerardo-cauich closed 2 months ago
@marc0der has something changed with regards to the version (binary)?
I also installed without Homebrew via https://sdkman.io/install and the sdk version
command works fine.
I think the problem is related to the recent changes to the selfupdate mechanism. I'm already preparing a fix.
Thanks for reporting!
To report that it's still an issue:
$ sdk version
'/usr/local/opt/sdkman-cli/libexec/var/version': No such file or directory (os error 2)
Same problem here (I use bat
vs cat
+ zsh
):
$ sdk version
[bat error]: '/opt/homebrew/opt/sdkman-cli/libexec/var/version': No such file or directory (os error 2)
SDKMAN
Other commands such as install
, list
, etc. also all fail.
Prefer to use a package manager (eg Macports or Homebrew) to facilitate automatic updates for all pkgs vs recalling to update sdkman!
by itself).
Same here, doesn't work when installing via Homebrew. Had to install using the official bash script.
I am also running into this issue. After running the commands in the README, I get the below error when running sdk version
% sdk version
cat: /opt/homebrew/opt/sdkman-cli/libexec/var/version: No such file or directory
SDKMAN
However, I seem to be able to run commands fine. I just ran sdk install java
and it was successful.
Additionally when I run which sdk
it spits out a script.
% which sdk
sdk () {
COMMAND="$1"
QUALIFIER="$2"
case "$COMMAND" in
(l) COMMAND="list" ;;
(ls) COMMAND="list" ;;
(v) COMMAND="version" ;;
(u) COMMAND="use" ;;
(i) COMMAND="install" ;;
(rm) COMMAND="uninstall" ;;
(c) COMMAND="current" ;;
(ug) COMMAND="upgrade" ;;
(d) COMMAND="default" ;;
(h) COMMAND="home" ;;
(e) COMMAND="env" ;;
esac
if [[ "$COMMAND" != "update" ]]
then
___sdkman_check_candidates_cache "$SDKMAN_CANDIDATES_CACHE" || return 1
fi
SDKMAN_AVAILABLE="true"
if [ -z "$SDKMAN_OFFLINE_MODE" ]
then
SDKMAN_OFFLINE_MODE="false"
fi
__sdkman_update_service_availability
if [ -f "${SDKMAN_DIR}/etc/config" ]
then
source "${SDKMAN_DIR}/etc/config"
fi
if [[ -z "$COMMAND" ]]
then
___sdkman_help
return 1
fi
CMD_FOUND=""
if [[ "$COMMAND" != "selfupdate" || "$sdkman_selfupdate_feature" == "true" ]]
then
CMD_TARGET="${SDKMAN_DIR}/src/sdkman-${COMMAND}.sh"
if [[ -f "$CMD_TARGET" ]]
then
CMD_FOUND="$CMD_TARGET"
fi
fi
CMD_TARGET="${SDKMAN_DIR}/ext/sdkman-${COMMAND}.sh"
if [[ -f "$CMD_TARGET" ]]
then
CMD_FOUND="$CMD_TARGET"
fi
if [[ -z "$CMD_FOUND" ]]
then
echo ""
__sdkman_echo_red "Invalid command: $COMMAND"
echo ""
___sdkman_help
fi
if [[ -n "$QUALIFIER" && "$COMMAND" != "help" && "$COMMAND" != "offline" && "$COMMAND" != "flush" && "$COMMAND" != "selfupdate" && "$COMMAND" != "env" && "$COMMAND" != "completion" && "$COMMAND" != "edit" && "$COMMAND" != "home" && -z $(echo ${SDKMAN_CANDIDATES[@]} | grep -w "$QUALIFIER") ]]
then
echo ""
__sdkman_echo_red "Stop! $QUALIFIER is not a valid candidate."
return 1
fi
if [[ "$COMMAND" == "offline" && -n "$QUALIFIER" && -z $(echo "enable disable" | grep -w "$QUALIFIER") ]]
then
echo ""
__sdkman_echo_red "Stop! $QUALIFIER is not a valid offline mode."
fi
local final_rc=0
local native_command="${SDKMAN_DIR}/libexec/${COMMAND}"
if [ -f "$native_command" ]
then
"$native_command" "${@:2}"
elif [ -n "$CMD_FOUND" ]
then
local converted_command_name=$(echo "$COMMAND" | tr '-' '_')
__sdk_"$converted_command_name" "${@:2}"
fi
final_rc=$?
return $final_rc
}
To report that it's still an issue: `sdk version cat: /opt/homebrew/opt/sdkman-cli/libexec/var/version: No such file or directory
SDKMAN`
Hi @Katherine620, it looks like this tap is no longer maintained.
@helpermethod any thoughts? I think if we can't make it work, we should rather archive the project.
@marc0der Yes, we should probably archive the project for now. I have some ideas on how to make this work, but we can't use jreleaser for this anymore (as the formula would need to consume releases from two different projects).
Hi @Katherine620,
I've put in some time to rework the tap, it now prints the version and takes the (platform-dependent) native-extensions into account. PR is already open :).
Happy to test if there's a way to specify a branch on brew tap
or brew install
.
Forked, merged the bugfix branch on my fork, tapped it and installed sdkman. sdk version
works!
Version is still not printed. Tapped and installed it today: oleksandryuvko@oylaptop ~ % sdk version cat: /opt/homebrew/opt/sdkman-cli/libexec/var/version: No such file or directory
SDKMAN
UPD: Oh, the PR is still on OPEN stage, I see.
Version is still not printed. Tapped and installed it today: oleksandryuvko@oylaptop ~ % sdk version cat: /opt/homebrew/opt/sdkman-cli/libexec/var/version: No such file or directory
SDKMAN
UPD: Oh, the PR is still on OPEN stage, I see.
You can try my test fork with brew tap davidfmatheson/tap
. That's just taking the PR and merging the branch on my fork.
Version is still not printed. Tapped and installed it today: oleksandryuvko@oylaptop ~ % sdk version cat: /opt/homebrew/opt/sdkman-cli/libexec/var/version: No such file or directory SDKMAN UPD: Oh, the PR is still on OPEN stage, I see.
You can try my test fork with
brew tap davidfmatheson/tap
. That's just taking the PR and merging the branch on my fork.
Cool, thanks 👍
The PR has been merged and should fix most problems.
I followed these instructions on my Macbook, but by modifiying
.zshrc
rather than.bash-profile
, and I got the following issue duringsdk version
:And indeed that file doesn't exist.
Macbook: MacBook Pro 2020 (Intel) MacOS: Version 13.3.1 (22E261) SDKMAN: 5.18.1
All other commands appear to work though.