vinayakb | 7ff0f4a | 2010-06-17 19:41:17 +0000 | [diff] [blame] | 1 | #!/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 | # |
| 32 | if [ -z "$CLASSPATH" ]; then |
| 33 | CLASSPATH="@classpath@" |
| 34 | else |
| 35 | CLASSPATH="@classpath@:$CLASSPATH" |
| 36 | fi |
| 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 | |
| 60 | MAIN_CLASS="@main.class@" |
| 61 | JVM_PARAMS="@jvm.params@" |
| 62 | |
| 63 | # Cygwin support. $cygwin _must_ be set to either true or false. |
| 64 | case "`uname`" in |
| 65 | CYGWIN*) cygwin=true ;; |
| 66 | *) cygwin=false ;; |
| 67 | esac |
| 68 | |
| 69 | # For Cygwin, ensure paths are in UNIX format before anything is touched |
| 70 | if $cygwin; then |
| 71 | [ -n "$JAVA_HOME" ] && |
| 72 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` |
| 73 | [ -n "$CLASSPATH" ] && |
| 74 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` |
| 75 | fi |
| 76 | |
| 77 | # Try to find java virtual machine |
| 78 | if [ -z "${JAVA}" ]; then |
| 79 | if [ -z "${JAVA_HOME}" ]; then |
| 80 | JAVA=java |
| 81 | else |
| 82 | JAVA=${JAVA_HOME}/bin/java |
| 83 | fi |
| 84 | fi |
| 85 | |
| 86 | # Try to find directory where this script is located |
| 87 | COMMAND="${PWD}/$0" |
| 88 | if [ ! -f "${COMMAND}" ]; then |
| 89 | COMMAND="$0" |
| 90 | fi |
| 91 | BASEDIR=`expr "${COMMAND}" : '\(.*\)/\.*'` |
| 92 | |
| 93 | # For Cygwin, switch paths to Windows format before running java |
| 94 | if $cygwin; then |
| 95 | # JAVA=`cygpath --path --windows "$JAVA"` |
| 96 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` |
| 97 | fi |
| 98 | |
| 99 | # Run program |
| 100 | ${JAVA} ${JVM_PARAMS} ${JVM_PARAMETERS} -classpath "${CLASSPATH}" ${MAIN_CLASS} $* |