Skip to content

Instantly share code, notes, and snippets.

@maciej
Created October 20, 2014 23:20
Show Gist options
  • Select an option

  • Save maciej/3405588c411aafcf71b2 to your computer and use it in GitHub Desktop.

Select an option

Save maciej/3405588c411aafcf71b2 to your computer and use it in GitHub Desktop.
Utility to quickly change the JAVA_HOME in OSX
function jh
if test -e /usr/libexec/java_home
set _jh (/usr/libexec/java_home -v 1.$argv)
if test -n $_jh
echo "Setting JAVA_HOME to $_jh"
set -gx JAVA_HOME $_jh
else
echo "Could not find java version $argv"
end
else
echo "java_home helper not found!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment