Created
June 13, 2014 07:56
-
-
Save bizenn/6235bab71ebd3bb86b3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- apache-maven-3.2.1.ORIG/bin/mvn 2014-02-15 02:40:05.000000000 +0900 | |
+++ apache-maven-3.2.1/bin/mvn 2014-06-13 16:37:15.000000000 +0900 | |
@@ -133,16 +133,21 @@ | |
fi | |
if [ -z "$JAVA_HOME" ]; then | |
- javaExecutable="`which javac`" | |
- if [ -n "$javaExecutable" -a ! "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then | |
- # readlink(1) is not available as standard on Solaris 10. | |
- readLink=`which readlink` | |
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then | |
- javaExecutable="`readlink -f \"$javaExecutable\"`" | |
- javaHome="`dirname \"$javaExecutable\"`" | |
- javaHome=`expr "$javaHome" : '\(.*\)/bin'` | |
- JAVA_HOME="$javaHome" | |
- export JAVA_HOME | |
+ if [ -x /usr/libexec/java_home ]; then | |
+ JAVA_HOME=`/usr/libexec/java_home` | |
+ export JAVA_HOME | |
+ else | |
+ javaExecutable="`which javac`" | |
+ if [ -n "$javaExecutable" -a ! "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then | |
+ # readlink(1) is not available as standard on Solaris 10. | |
+ readLink=`which readlink` | |
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then | |
+ javaExecutable="`readlink \"$javaExecutable\"`" | |
+ javaHome="`dirname \"$javaExecutable\"`" | |
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'` | |
+ JAVA_HOME="$javaHome" | |
+ export JAVA_HOME | |
+ fi | |
fi | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment