blob: 25e9e285359f0bc9bd74cd8545894100b01c3356 [file] [log] [blame]
vinayakb0c860392012-10-06 18:47:20 +00001#!/bin/sh
Till Westmann276bbc22013-06-05 18:56:27 -07002#/*
3# Copyright 2009-2013 by The Regents of the University of California
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# you may obtain a copy of the License from
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#*/
vinayakb0c860392012-10-06 18:47:20 +000016# JAVA classpath
17# Use the local variable CLASSPATH to add custom entries (e.g. JDBC drivers) to
18# the classpath. Separate multiple paths with ":". Enclose the value
19# in double quotes. Adding additional files or locations on separate
20# lines makes things clearer.
21# Note: If under running under cygwin use "/cygdrive/c/..." for "C:/..."
22# Example:
23#
24# Set the CLASSPATH to a jar file and a directory. Note that
25# "classes dir" is a directory of class files with a space in the name.
26#
27# CLASSPATH="usr/local/Product1/lib/product.jar"
28# CLASSPATH="${CLASSPATH}:../MyProject/classes dir"
29#
30CLASSPATH="@classpath@"
31
32# JVM parameters
33# If you want to modify the default parameters (e.g. maximum heap size -Xmx)
34# for the Java virtual machine set the local variable JVM_PARAMETERS below
35# Example:
36# JVM_PARAMETERS=-Xms100M -Xmx200M
37#
38# Below are the JVM parameters needed to do remote debugging using Intellij
39# IDEA. Uncomment and then do: JVM_PARAMETERS="$IDEA_REMOTE_DEBUG_PARAMS"
40# IDEA_REMOTE_DEBUG_PARAMS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
41#
42# JVM_PARAMETERS=
43
44#run with shared memory setup
45#if [ -n "${RUN_SHARED_MEM}"]; then
46# JVM_PARAMETERS="${JVM_PARAMETERS} -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=n,address=javadebug,suspend=y"
47#fi
48
49# ---------------------------------------------------------------------------
50# Default configuration. Do not modify below this line.
51# ---------------------------------------------------------------------------
52# Application specific parameters
53
54MAIN_CLASS="@main.class@"
55JVM_PARAMS="@jvm.params@"
56PROGRAM_PARAMS="@program.params@"
57
58# Cygwin support. $cygwin _must_ be set to either true or false.
59case "`uname`" in
60 CYGWIN*) cygwin=true ;;
61 *) cygwin=false ;;
62esac
63
64# For Cygwin, ensure paths are in UNIX format before anything is touched
65if $cygwin; then
66 [ -n "$JAVA_HOME" ] &&
67 JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
68 [ -n "$CLASSPATH" ] &&
69 CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
70fi
71
72# Try to find java virtual machine
73if [ -z "${JAVA}" ]; then
74 if [ -z "${JAVA_HOME}" ]; then
75 JAVA=java
76 else
77 JAVA=${JAVA_HOME}/bin/java
78 fi
79fi
80
81# Try to find directory where this script is located
82COMMAND="${PWD}/$0"
83if [ ! -f "${COMMAND}" ]; then
84 COMMAND="$0"
85fi
86BASEDIR=`expr "${COMMAND}" : '\(.*\)/\.*'`
87
88# For Cygwin, switch paths to Windows format before running java
89if $cygwin; then
90# JAVA=`cygpath --path --windows "$JAVA"`
91 CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
92fi
93
94# Run program
95${JAVA} ${JVM_PARAMS} ${JVM_PARAMETERS} -classpath "${CLASSPATH}" ${MAIN_CLASS} ${PROGRAM_PARAMS} $*