home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / inprise / JSAMPLES.Z / runnit < prev    next >
Text File  |  1998-05-08  |  1KB  |  42 lines

  1. #!/bin/sh
  2. #
  3. # @(#)runnit    1.4 98/01/31
  4. #
  5. # runnit script for Metalworks
  6.  
  7.  
  8. if [ -z "${JAVA_HOME}" ] ; then
  9.     if [ -d /usr/local/java/jdk1.1.5/solaris ] ; then
  10.         JAVA_HOME=/usr/local/java/jdk1.1.5/solaris
  11.     CLASSPATH=.:/usr/local/java/jdk1.1.5/solaris/lib/classes.zip
  12.     export CLASSPATH
  13.     else
  14.         echo "JAVA_HOME environment variable not set." 1>&2 
  15.         exit 1
  16.     fi
  17. fi
  18.  
  19. cd classes
  20.  
  21. # Compute an absolute pathname here because Class.getResource()
  22. # fails if $CLASSPATH contains "../".
  23. if [ -d ../../../1.1_demo ] ; then
  24.     SWING_HOME=`(cd ../../../1.1_classes; pwd)`
  25.     SWING_JARS=${SWING_HOME}
  26. else
  27.     SWING_HOME=`(cd ../../../; pwd)`
  28.     SWING_JARS=${SWING_HOME}/swing.jar:${SWING_HOME}/windows.jar:${SWING_HOME}/motif.jar:${SWING_HOME}/mac.jar
  29. fi
  30.  
  31. SWING_CLASSES=.:${SWING_JARS}
  32. if [ -z "$CLASSPATH" ] ; then
  33.     CLASSPATH="${SWING_CLASSES}":${JAVA_HOME}/lib/classes.zip
  34. else
  35.     CLASSPATH="${SWING_CLASSES}:$CLASSPATH"
  36. fi
  37.  
  38. CMD="${JAVA_HOME}/bin/java -classpath ${CLASSPATH} Metalworks"
  39.  
  40. echo ${CMD}
  41. ${CMD}
  42.