#!/bin/sh

# Java command
JAVA_CMD=java

# Check if GCJ
$JAVA_CMD -version 2>&1 | grep -i -q "gcj\|gnu\|gij"
if [ $? -eq 0 ]
then
	echo "You seem to be running GNU's Java implementation, which is incomplete."
	echo "Jin requires Sun's Java (or a fully compatible version) 1.4 or later."
	echo "If you can't install it with your distribution's package manager, you"
	echo "can obtain and install it manually from http://www.java.com"
	exit
fi

# Follow links
filename=`readlink -f $0`
if [ -z "$filename" ]
then
	filename=$0
fi

# Change to Jin's directory - Jin needs to be run from its directory
cd `dirname $filename`

# Run Jin
$JAVA_CMD $JAVA_OPTS -jar jin.jar $*
