#!/bin/bash

SWIPL_LIBRARY="/usr/lib/swi-prolog/lib/x86_64-linux"

dir=$(cd "$(dirname "$0")"; pwd)
# change directory
#cd $dir
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server
export LD_PRELOAD=$LD_PRELOAD:${SWIPL_LIBRARY}/libswipl.so
java -Djava.library.path=$dir:${SWIPL_LIBRARY} -jar $dir/bundle-*-standalone.jar "$@"
# return to the previous directory
#cd -