diff .bashrc @ 879:79b52aec477e

function for java_home
author Jeff Hammel <k0scist@gmail.com>
date Fri, 24 May 2019 15:34:11 -0700
parents 297cb56a2360
children 47d50c70ec04
line wrap: on
line diff
--- a/.bashrc	Sat May 11 14:39:45 2019 -0700
+++ b/.bashrc	Fri May 24 15:34:11 2019 -0700
@@ -599,6 +599,10 @@
 while read line;  do echo ${line} : $(($(test "-e ${line}"\") )); done
 }
 
+java_home() {
+    /usr/bin/env java -XshowSettings:properties -version 2>&1 | grep "java.home" | awk '{ print $NF; }'
+}
+
 ### ruby version manager
 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
 export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting