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