#!/bin/sh
if [ "$#" -lt 2 ]; then
	alert --stop "Java: Please specify a Jarfile." >/dev/null
	exit 1
fi

OUTPUT=$(cmdjava -jar $@ 2>&1)
RETCODE=$?
if [[ $OUTPUT == "Error"* ]]; then
	alert --stop "Java: $OUTPUT" >/dev/null
	exit $RETCODE
fi
