#!/bin/sh
#
# Runs jEdit - Programmer's Text Editor.
#

# Set jvm heap initial and maximum sizes (in megabytes).
JAVA_HEAP_MAX_SIZE=192

# Find a java installation.
if [ -z "$JAVA_HOME" ]; then
	echo "Warning: \$JAVA_HOME environment variable not set! Consider setting it."
	echo "          Attempting to locate java..."
	j=`which java 2>/dev/null`
	if [ -z "$j" ]; then
		echo "Failed to locate the java virtual machine! Bailing..."
		exit 1
	else
		echo "Found a virtual machine at: $j..."
		JAVA="$j"
	fi
else
	JAVA="$JAVA_HOME/bin/java"
fi

# Launch application.

exec $JAVA -Xmx${JAVA_HEAP_MAX_SIZE}M -jar /usr/share/jEdit/@jar.filename@ -reuseview "$@" &
