Adding logging configuration for tomcat (JULI)
[controller.git] / opendaylight / distribution / opendaylight / src / main / resources / run.sh
index 6caf3e3f57c55aa0f3c2d88f70e43dde7de355b8..e4c20da350b87fac520cab4b9d2dac48881f1810 100755 (executable)
@@ -10,6 +10,15 @@ fi
 
 if [[ $platform == 'linux' ]]; then
    fullpath=`readlink -f $0`
+
+   if [[ -z ${JAVA_HOME} ]]; then
+      # Find the actual location of the Java launcher:
+      java_launcher=`which java`
+      java_launcher=`readlink -f "${java_launcher}"`
+
+      # Compute the Java home from the location of the Java launcher:
+      export JAVA_HOME="${java_launcher%/bin/java}"
+    fi
 elif [[ $platform == 'osx' ]]; then
    TARGET_FILE=$0
    cd `dirname $TARGET_FILE`