Skip to content

Instantly share code, notes, and snippets.

@tommysdk
Last active April 2, 2024 02:48
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save tommysdk/35053b71293d1a28d5f207ebb5abbf93 to your computer and use it in GitHub Desktop.
Save tommysdk/35053b71293d1a28d5f207ebb5abbf93 to your computer and use it in GitHub Desktop.
Change default Java version on Mac OS X using Fish shell
# Based on https://stackoverflow.com/a/26252993/1665539
# Show all installed Java versions
/usr/libexec/java_home -V
# Select major version (if unique, otherwise specify full name e.g. 1.8.0_131)
set -x JAVA_HOME (/usr/libexec/java_home -v 1.8)
# Verify
java -version
@Ramanpreetsingh
Copy link

Thanks for sharing.(y)

@muntasir84
Copy link

Thanks a lot

@emilionavarro
Copy link

Beautiful. Thanks!

@nicholasxjy
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment