Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Last active July 24, 2024 07:29
Show Gist options
  • Save dongyuwei/ceb68686760ebc26ba5fb148cf785f5d to your computer and use it in GitHub Desktop.
Save dongyuwei/ceb68686760ebc26ba5fb148cf785f5d to your computer and use it in GitHub Desktop.
function j11
set -gx JAVA_HOME /Users/yuweidong/Downloads/jdk-11.0.21.jdk/Contents/Home/
set -l old_path (string match -v "$JAVA_HOME/bin" $PATH)
set -gx PATH $JAVA_HOME/bin $old_path
java --version
end
function j17
set -gx JAVA_HOME /Users/yuweidong/Downloads/jdk-17.0.11.jdk/Contents/Home/
set -l old_path (string match -v "$JAVA_HOME/bin" $PATH)
set -gx PATH $JAVA_HOME/bin $old_path
java --version
end
## run j17 will switch jdk to v17 in **fish shell**.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment