blob: aa9c5137090266623378b1c48d940b0b351e7629 [file] [log] [blame]
Jonathan Hartfe990382013-02-06 15:22:32 -08001#!/bin/bash
2
HIGUCHI Yutae7aa9252013-06-06 14:54:21 -07003ONOS_DIR="`dirname $0`/.."
4#CP=$( echo `dirname $0`/../lib/*.jar `dirname $0`/../lib/titan/*.jar . | sed 's/ /:/g')
5CP=`mvn -f ${ONOS_DIR}/pom.xml dependency:build-classpath -Dmdep.outputFile=/dev/stdout -l /dev/stderr`
Jonathan Hartfe990382013-02-06 15:22:32 -08006
7# Find Java
8if [ "$JAVA_HOME" = "" ] ; then
9 JAVA="java -server"
10else
11 JAVA="$JAVA_HOME/bin/java -server"
12fi
13
14# Set Java options
15if [ "$JAVA_OPTIONS" = "" ] ; then
16 JAVA_OPTIONS="-Xms32m -Xmx512m"
17fi
18
19# Launch the application
20if [ "$1" = "-e" ]; then
21 k=$2
22 if [ $# -gt 2 ]; then
23 for (( i=3 ; i < $# + 1 ; i++ ))
24 do
25 eval a=\$$i
26 k="$k \"$a\""
27 done
28 fi
29
30 eval $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.thinkaurelius.titan.tinkerpop.gremlin.ScriptExecutor $k
31else
32 if [ "$1" = "-v" ]; then
33 $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.tinkerpop.gremlin.Version
34 else
35 $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.thinkaurelius.titan.tinkerpop.gremlin.Console
36 fi
37fi
38
39# Return the program's exit code
40exit $?