blob: 4915636311248fbfdd41772b05973d30f7a9f63c [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001#!/bin/sh
Till Westmannea8ab392013-06-05 15:17:08 -07002#/*
Ian Maxon928bbd12015-09-14 17:12:48 -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.
vinayakb38b7ca42012-03-05 05:44:15 +000019# JAVA classpath
20# Use the local variable CLASSPATH to add custom entries (e.g. JDBC drivers) to
21# the classpath. Separate multiple paths with ":". Enclose the value
22# in double quotes. Adding additional files or locations on separate
23# lines makes things clearer.
24# Note: If under running under cygwin use "/cygdrive/c/..." for "C:/..."
25# Example:
26#
27# Set the CLASSPATH to a jar file and a directory. Note that
28# "classes dir" is a directory of class files with a space in the name.
29#
30# CLASSPATH="usr/local/Product1/lib/product.jar"
31# CLASSPATH="${CLASSPATH}:../MyProject/classes dir"
32#
33CLASSPATH="@classpath@"
34
35# JVM parameters
36# If you want to modify the default parameters (e.g. maximum heap size -Xmx)
37# for the Java virtual machine set the local variable JVM_PARAMETERS below
38# Example:
39# JVM_PARAMETERS=-Xms100M -Xmx200M
40#
41# Below are the JVM parameters needed to do remote debugging using Intellij
42# IDEA. Uncomment and then do: JVM_PARAMETERS="$IDEA_REMOTE_DEBUG_PARAMS"
43# IDEA_REMOTE_DEBUG_PARAMS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
44#
45# JVM_PARAMETERS=
46
47#run with shared memory setup
48#if [ -n "${RUN_SHARED_MEM}"]; then
49# JVM_PARAMETERS="${JVM_PARAMETERS} -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=n,address=javadebug,suspend=y"
50#fi
51
52# ---------------------------------------------------------------------------
53# Default configuration. Do not modify below this line.
54# ---------------------------------------------------------------------------
55# Application specific parameters
56
57MAIN_CLASS="@main.class@"
58JVM_PARAMS="@jvm.params@"
59PROGRAM_PARAMS="@program.params@"
60
61# Cygwin support. $cygwin _must_ be set to either true or false.
62case "`uname`" in
63 CYGWIN*) cygwin=true ;;
64 *) cygwin=false ;;
65esac
66
67# For Cygwin, ensure paths are in UNIX format before anything is touched
68if $cygwin; then
69 [ -n "$JAVA_HOME" ] &&
70 JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
71 [ -n "$CLASSPATH" ] &&
72 CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
73fi
74
75# Try to find java virtual machine
76if [ -z "${JAVA}" ]; then
77 if [ -z "${JAVA_HOME}" ]; then
78 JAVA=java
79 else
80 JAVA=${JAVA_HOME}/bin/java
81 fi
82fi
83
84# Try to find directory where this script is located
85COMMAND="${PWD}/$0"
86if [ ! -f "${COMMAND}" ]; then
87 COMMAND="$0"
88fi
89BASEDIR=`expr "${COMMAND}" : '\(.*\)/\.*'`
90
91# For Cygwin, switch paths to Windows format before running java
92if $cygwin; then
93# JAVA=`cygpath --path --windows "$JAVA"`
94 CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
95fi
96
97# Run program
98${JAVA} ${JVM_PARAMS} ${JVM_PARAMETERS} -classpath "${CLASSPATH}" ${MAIN_CLASS} ${PROGRAM_PARAMS} $*