#! /bin/bash # Create the ~/processing directory, in case it doesn't exist yet. if [ ! -d ~/processing ] then mkdir ~/processing fi # Look for java and start it JAVA= # Find out current sun-java versions JREs=$(/usr/sbin/update-alternatives --list java | grep sun) for BINARY in $JREs do # See if the version is >= 1.4 VERSION=$($BINARY -version 2>&1 | head -n1 | sed -r "s/.*\"([0-9]\.[0-9])\..*/\1/g") ALLOW=$(expr $VERSION ">=" 1.4) if [ $ALLOW -eq 1 ] then JAVA=$BINARY break; fi done if [ $JAVA ] then # Go! echo "Starting Processing using $JAVA... " export CLASSPATH=lib:lib/build:lib/pde.jar:lib/core.jar:lib/oro.jar:lib/registry.jar:lib/mrj.jar:lib/antlr.jar cd /usr/share/processing $JAVA processing.app.Base else # Java not found... echo "Processing could not be started, because no suitable Java Runtime Environment was found. "; if [ -x "/usr/bin/notify-send" ] then notify-send --urgency=critical "Processing" "Processing could not be started, because no suitable Java Runtime Environment was found. " fi fi