Skip to content

Instantly share code, notes, and snippets.

View xixiaofinland's full-sized avatar

Xi Xiao xixiaofinland

View GitHub Profile
@xixiaofinland
xixiaofinland / setjdk.fish
Created October 2, 2018 09:13 — forked from tobias/setjdk.fish
Manage multiple java versions on the mac from the fish shell
function setjdk
if test -n "$JAVA_HOME"
removeFromPath "$JAVA_HOME/bin"
end
set -gx JAVA_HOME (/usr/libexec/java_home -v $argv[1])
set -gx PATH $JAVA_HOME/bin $PATH
end
function removeFromPath
set -l idx 0