shyiko / jabba

(cross-platform) Java Version Manager
3k stars 194 forks source link

Jabba installed through homebrew not working #138

Open eliasbagley opened 6 years ago

eliasbagley commented 6 years ago

running the command sequence:

brew install jabba
jabba install zulu@1.8.121
jabba use zulu@1.8.121
echo $JAVA_HOME

results in the $JAVA_HOME environment variable not being set.

Also running jabba current doesn't return anything either.

zulu@1.8.121 is listed as being installed when I run jabba ls

I can confirm these same command work as expected when installed through the curl script.

Jabba version 0.9.2 OSX High Sierra

shyiko commented 6 years ago

Hi Elias.

Interesting. I wasn't aware that is available through Homebrew :) From what I can tell https://github.com/Homebrew/homebrew-core/blob/master/Formula/jabba.rb is missing shell integration scripts (e.g. https://github.com/shyiko/jabba/blob/master/install.sh#L91). Without them none of the jabba commands will have any effect on the shell environment.

satyanash commented 6 years ago

What's the best way to fix this? I like all my packages coming in through brew.

shyiko commented 6 years ago

I'll update homebrew formula to include shell integration as soon as 1.0.0 is out (it's near completion).

fuzzyweapon commented 6 years ago

Awaiting with baited breath!

thiagolocatelli commented 6 years ago

Has this been fixed? I am using linuxbrew and ubuntu 18.04 and I am facing the same issue. Thank you.

mcandre commented 5 years ago

Neither is JAVA_HOME set, nor are the jabba-active java/javac in PATH.

nimble-123 commented 5 years ago

Error still exists. Will this be fixed or do we have to switch to not-brew installed jabba?

GargantulaKon commented 5 years ago

It still doesn't work. I had to uninstall jabba with brew uninstall jabba and then I ran the curl command on the README.md file and it worked.

vitor251093 commented 4 years ago

It still doesn't work. I had to uninstall jabba with brew uninstall jabba and then I ran the curl command on the README.md file and it worked.

Thanks! That worked for me as well!

At this moment, this is the curl command, to save time of the next one running into that issue:

curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
fabasoad commented 3 years ago

Wow, this opened issue in 2018 is still relevant.. jabba installed by brew didn't work for me, so I had to install it via curl. Are there any estimations when it will be fixed? Can we somehow help with it?

LukeSamkharadze commented 2 years ago

Lol, after 4 years, still doesn't work

@shyiko any updates?

albertoadami commented 1 year ago

Also on my Mac I'm getting the same issue, via homebrew the dependency seems to not working correcly and update the JAVA_HOME variable. So I needed to change it "by hands".

Is there any planning fix about this?

wkeese commented 2 months ago

The https://formulae.brew.sh/formula/jabba instruction page says that you need to add this to your .zshrc:

[ -s "$HOMEBREW_PREFIX/opt/jabba/share/jabba/jabba.sh" ] && . "$HOMEBREW_PREFIX/opt/jabba/share/jabba/jabba.sh"

However, that's wrong, at least on the Mac. Instead, this works:

[ -s "$HOMEBREW_PREFIX/opt/jabba/jabba.sh" ] && . "$HOMEBREW_PREFIX/opt/jabba/jabba.sh"