Open rubin55 opened 5 years ago
Same problem here.
If you installed Jabba through homebrew, that's could be the issue, the install method listed on github (wget piped into bash) works correctly and sets up some shell integrations, but the homebrew install does not :( (see also https://github.com/shyiko/jabba/issues/138)
Fyi, I did not install through homebrew but using wget.
I uninstalled homebrew version and installed using the official wget method. That fixed the issue and now jabbba updates my local path to the desired java binary.
:/ Not in a habit of doing curl | bash
very often. Might be good to publish what extra setup the script does
I wound up just adding the following to my .zshrc until this is resolved:
JABBA_HOME=$HOME/.jabba
JABBA_HOME_TO_EXPORT=\$HOME/.jabba
_jabba() {
local fd3=$(mktemp /tmp/jabba-fd3.XXXXXX)
(JABBA_SHELL_INTEGRATION=ON `which jabba` "$@" 3>| ${fd3})
local exit_code=$?
eval $(cat ${fd3})
rm -f ${fd3}
return ${exit_code}
}
if [ ! -z "$(_jabba alias default)" ]; then
_jabba use default
fi
This is just a slight modification of what's done in the install script: https://github.com/shyiko/jabba/blob/master/install.sh#L134
See below for command line session; this is on macOS Mojave 10.14.5 with AdoptOpenJDK 8 and 11, openj9 variants:
I.e, java version does not change, I expect the second invocation of
java -version
to come from the JDK represented bysystem@11
.