#!/bin/sh

JVM=/usr/local/bin/java
JVMFLAGS=

# Set PATH to the jar needed by the print program
GUI_LIBDIR=/usr/local/mpich2/lib
GUI_HOME=${GUI_LIBDIR}/..
# MAIN_LIB=${GUI_LIBDIR}/slog2printrecur.jar
MAIN_LIB=${GUI_LIBDIR}/slog2printserial.jar


if [ -z "${GUI_LIBDIR}" -o "${GUI_LIBDIR}" = "/lib" ]; then
    echo "GUI_LIBDIR is NOT set!"
    exit 1
else
    echo "GUI_LIBDIR is set. GUI_LIBDIR = "${GUI_LIBDIR}
fi

if [ -z "`echo $JVMFLAGS | grep '\-Xms'`" ] ; then
    JVMFLAGS="-Xms32m $JVMFLAGS"
fi
if [ -z "`echo $JVMFLAGS | grep '\-Xmx'`" ] ; then
    JVMFLAGS="-Xmx128m $JVMFLAGS"
fi

${JVM} ${JVMFLAGS} -jar ${MAIN_LIB} "$@"
