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