#!/bin/bash
cd $(dirname $0)

cd ../..
if [ ! -f libnomointerpreter.so ]
then
    bash build.sh
fi
cd $(dirname $0)
cp ../HelloWorld.seed  ./

export LIBRARY_PATH=../..:$LIBRARY_PATH
export LD_LIBRARY_PATH=../..:$LD_LIBRARY_PATH
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
export PATH=/usr/lib/jvm/java-7-openjdk-i386/bin:$PATH

CLASSES_IN=.:jna-3.4.0.jar
CLASSES_OUT=.
SOURCES=.
rm -f *.class
javac -g -classpath $CLASSES_IN -d $CLASSES_OUT -sourcepath $SOURCES Test.java
echo Press any key to start java application
read

java -classpath $CLASSES_IN Test

echo Press any key to exit
read

exit 0
