#!/bin/bash

# java executable
JAVA=java
#JAVA=/opt/IBMJava2-141/bin/java
#JAVA_OPT=
# -enableassertions

# jist directories
JIST_DIR=`dirname $0`/../
JIST_LIBS=${JIST_DIR}/libs/bcel.jar:${JIST_DIR}/libs/bsh.jar:${JIST_DIR}/libs/jargs.jar:${JIST_DIR}/libs/log4j.jar:${JIST_DIR}/libs/jython.jar:${JIST_DIR}/classes

# .so path
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${JIST_SRC}/jist/swans/misc
export LD_LIBRARY_PATH

# max heap
#MEM=`cat /proc/meminfo | grep MemTotal | grep -o "[0-9]\+"`
#MEM=$(( ($MEM-200000)/1024 ))

#JAVA_OPT=-server -Xmx${MEM}m
JAVA_OPT="-server -Djava.library.path=/home/kurth/projects/laptop/click/click-core/jist"

JIST_ARGS="--nocache"
#-c ${JIST_DIR}/res/debug-click.properties"

# run spot, run
#echo "exec ${JAVA} -cp ${JIST_LIBS} ${JAVA_OPT}  jist.runtime.Main ${JIST_ARGS} $*"
exec ${JAVA} -cp ${JIST_LIBS} ${JAVA_OPT}  jist.runtime.Main ${JIST_ARGS} $*
