Yuta HIGUCHI

onos command to use Java 1.8

Change-Id: I8741c41a74dba3b816a838aa1db1588be7f9816a
...@@ -3,7 +3,15 @@ ...@@ -3,7 +3,15 @@
3 # ONOS command-line client 3 # ONOS command-line client
4 # ----------------------------------------------------------------------------- 4 # -----------------------------------------------------------------------------
5 5
6 -export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/} 6 +if [ -z "${JAVA_HOME}" ]; then
7 + if [ -x /usr/libexec/java_home ]; then
8 + export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
9 + elif [ -d /usr/lib/jvm/java-8-oracle ]; then
10 + export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
11 + elif [ -d /usr/lib/jvm/java-7-openjdk-amd64 ]; then
12 + export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
13 + fi
14 +fi
7 15
8 cd $(dirname $0)/../apache-karaf-$KARAF_VERSION/bin 16 cd $(dirname $0)/../apache-karaf-$KARAF_VERSION/bin
9 ./client -h localhost -u karaf "$@" 17 ./client -h localhost -u karaf "$@"
......