Skip to content

Instantly share code, notes, and snippets.

@alexandreaquiles
Created March 21, 2018 16:13
Show Gist options
  • Save alexandreaquiles/f50cb0be3fb9e2c157e36d51215f21e7 to your computer and use it in GitHub Desktop.
Save alexandreaquiles/f50cb0be3fb9e2c157e36d51215f21e7 to your computer and use it in GitHub Desktop.
show current SDK Java version on the command prompt
#show java version on prompt
current_sdk_java_version() {
export PS1="\e[0;32m$(sdk current java version | grep version | sed -e 's/.*version \(.*\)/\1/')\e[m$ "
}
PROMPT_COMMAND="current_sdk_java_version"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment