X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fdistribution%2Fopendaylight%2Fsrc%2Fmain%2Fresources%2Frun.sh;h=2587a5d2ab54de060c4a258713352febf4c97725;hb=96d2f3b1bc12f6db46bece17ef2982d4b7c73f80;hp=313b3b2c79cdd18dbf585f6a76adbeecf8e688f9;hpb=a0d6ba5c0dba435b963aa113469a5f52bc8245fd;p=controller.git diff --git a/opendaylight/distribution/opendaylight/src/main/resources/run.sh b/opendaylight/distribution/opendaylight/src/main/resources/run.sh index 313b3b2c79..2587a5d2ab 100755 --- a/opendaylight/distribution/opendaylight/src/main/resources/run.sh +++ b/opendaylight/distribution/opendaylight/src/main/resources/run.sh @@ -1,9 +1,5 @@ #!/bin/bash -[[ -z ${JAVA_HOME} ]] && echo "Need to set JAVA_HOME environment variable" && exit -1; -[[ ! -x ${JAVA_HOME}/bin/java ]] && echo "Cannot find an executable \ -JVM at path ${JAVA_HOME}/bin/java check your JAVA_HOME" && exit -1; - platform='unknown' unamestr=`uname` if [[ "$unamestr" == 'Linux' ]]; then @@ -32,8 +28,15 @@ elif [[ $platform == 'osx' ]]; then PHYS_DIR=`pwd -P` RESULT=$PHYS_DIR/$TARGET_FILE fullpath=$RESULT + + [[ -z ${JAVA_HOME} ]] && [[ -x "/usr/libexec/java_home" ]] && export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; + fi +[[ -z ${JAVA_HOME} ]] && echo "Need to set JAVA_HOME environment variable" && exit -1; +[[ ! -x ${JAVA_HOME}/bin/java ]] && echo "Cannot find an executable \ +JVM at path ${JAVA_HOME}/bin/java check your JAVA_HOME" && exit -1; + basedir=`dirname ${fullpath}` function usage {