#!/bin/sh

BASEDIR=$(dirname $0)   # directory to find vertica-udx-Java.jar
JAVA_BIN=$1             # path to java binary for starting the JVM
MAX_HEAP_KB=$2          # JVM max heap size in KB
CLASS_PATH=$3
shift                   # the rid of the args $1, $2, so that we can pass all the rest args to JVM
shift
shift

#################
# Instructions to use jdb/eclipse to debug side process:
#################
#
# 1) Uncomment the following command and comment out the one after that
# 2) Run your crashing java code
# 3) Attach to the side process (ideally within eclipse on port 9999)

#$JAVA_BIN -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999 -classpath $CLASS_PATH:$BASEDIR/vertica-udx-Java.jar -enableassertions:com.vertica...  com.vertica.udxfence.VerticaUDxJava $* $BASEDIR
$JAVA_BIN -Xmx$MAX_HEAP_KB -classpath $CLASS_PATH:$BASEDIR/vertica-udx-Java.jar -enableassertions:com.vertica... com.vertica.udxfence.VerticaUDxJava $* $BASEDIR
