#!/bin/ksh

if test -z "$COBDIR"
then
  print -u2 "$0: " 'Error: $COBDIR is not set'
  exit 1
fi

if test -z "$JAVA_HOME"
then
  print -u2 "$0: " 'Error: $JAVA_HOME is not set'
  exit 1
fi

if [[ -z $DISPLAY ]] ; then
  print -u2 "$0: " 'Error: $DISPLAY is not set'
  exit 1
fi

if test !  -f $COBDIR/lib/mfimtk.jar -o ! -f $COBDIR/lib/xerces.jar -o ! -f $COBDIR/lib/jakarta-oro-2_0_8.jar -o ! -f $COBDIR/lib/castor-0_9_7-xml.jar -o ! -f $COBDIR/lib/commons-logging.jar
then
  print -u2 "$0: Error: one or more dependent jar files not found in $COBDIR/lib:"
  print -u2 " mfimtk.jar"
  print -u2 " xerces.jar"
  print -u2 " jakarta-oro-2_0_8.jar"
  print -u2 " castor-0_9_7-xml.jar"
  print -u2 " commons-logging.jar"
  exit 2
fi
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$COBDIR/lib/mfimtk.jar:$COBDIR/lib/xerces.jar:$COBDIR/lib/jakarta-oro-2_0_8.jar:$COBDIR/lib/castor-0_9_7-xml.jar:$COBDIR/lib/commons-logging.jar:$CLASSPATH
java -version
java -classpath $CLASSPATH com.microfocus.imtk.ide.IDELauncher
