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