Last active
November 2, 2020 10:14
-
-
Save inoperable/8d29907bd58d1298207b3a70960ec03a to your computer and use it in GitHub Desktop.
Revisions
-
inoperable renamed this gist
Nov 2, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
inoperable created this gist
Nov 2, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # assuming sdkman is installed in default location: $HOME/.sdkman # grep selects only from INSTALLED candidates # # add to your .zshrc or .zshrc.local or save it as use-jdk.zsh and # load it on init with 'source ~/PATH/TO/SCRIPT/use-jdk.zsh' function use-jdk() { FUNCS=$(functions sdk); sdk ls java | grep installed | grep -Po "\|\s\d+.*|" | gawk '{ print $8 }' | fzf -e | xargs -I{} zsh -c "eval $FUNCS; . ~/.sdkman/bin/sdkman-init.sh; sdk default java {}" }