Skip to content
Browse files

Detect JDK using /usr/libexec/java_home

On my machine, CurrentJDK is not updated to point to Java 7
when I change the Java Preferences list order.

Therefore, the current symbolic link checking method does
not work, and returns Java 6.  Using /usr/libexec/java_home
seems to work (at least for me)

See "Java Home" here:
http://developer.apple.com/library/mac/#qa/qa1170/_index.html
  • Loading branch information...
1 parent c6c5a81 commit a2c67007cd922292a0c91616cf2c28db5310f413 @timyates committed May 10, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 grails-resources/src/grails/home/bash/startGrails
View
3 grails-resources/src/grails/home/bash/startGrails
@@ -52,6 +52,9 @@ if [ -z "$JAVA_HOME" ]; then
# Set JAVA_HOME for Darwin
if $darwin; then
+ [ -z "$JAVA_HOME" -a -f "/usr/libexec/java_home" ] &&
+ export JAVA_HOME=`/usr/libexec/java_home`
+
[ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] &&
export JAVA_HOME="/Library/Java/Home"

0 comments on commit a2c6700

Please sign in to comment.
Something went wrong with that request. Please try again.