2014-04-27 23:54:15 +00:00
|
|
|
for gvm_path in (find $HOME/.gvm/*/current/bin -maxdepth 0)
|
2014-11-29 06:15:30 +00:00
|
|
|
_prepend_path $gvm_path
|
2014-12-07 03:27:14 +00:00
|
|
|
set -l module_info (echo $gvm_path | perl -ne 'm|(.*/.gvm/(\w+)/current)/bin| && print "$1 $2"')
|
|
|
|
set -l module_dir (echo $module_info | awk -F' ' '{print $1}')
|
|
|
|
set -l module_name (echo $module_info | awk -F' ' '{print $2}')
|
|
|
|
set -l module_home (echo $module_name | tr '[:lower:]' '[:upper:]')_HOME
|
|
|
|
set -gx "$module_home" $module_dir
|
2014-11-29 06:15:30 +00:00
|
|
|
end
|
2014-12-07 03:27:14 +00:00
|
|
|
|
|
|
|
# ONLY checked on OSX! Please add for other OS's...
|
|
|
|
if test -z $JAVA_HOME
|
2014-12-26 18:47:59 +00:00
|
|
|
if test -f "/usr/libexec/java_home"
|
|
|
|
set -gx JAVA_HOME (/usr/libexec/java_home)
|
|
|
|
end
|
|
|
|
|
|
|
|
if test -z $JAVA_HOME
|
|
|
|
set -l java_homes "/Library/Java/Home" "/System/Library/Frameworks/JavaVM.framework/Home"
|
|
|
|
for file in $java_homes
|
|
|
|
if test -d $file
|
|
|
|
set -gx JAVA_HOME $file
|
|
|
|
break
|
2014-12-07 03:27:14 +00:00
|
|
|
end
|
2014-12-26 18:47:59 +00:00
|
|
|
end
|
|
|
|
end
|
2014-12-07 03:27:14 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
if test -z $JAVA_HOME
|
2014-12-26 18:47:59 +00:00
|
|
|
echo "GVM: JAVA_HOME not set please set JAVA_HOME."
|
2014-12-07 03:27:14 +00:00
|
|
|
end
|
|
|
|
|