ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Shell Scripts, Command Lines, and Classpaths
Subject:   the xeena script example isn't very complete
Date:   2005-05-22 07:38:52
From:   DimSum
Here is what I rewrote it as.


Note especially the use of 'exec' at the end (no reason to keep the script sitting around while the jvm runs) and the use of "$@" instead of $* -- $* will *not* work properly under all circumstances. I also included the #!/bin/sh to specify the shell to execute. To the users gettings errors doing setenv and such, you need to execute 'tcsh' by itself first to put you into the tcsh shell.



After you create this file (assume you called it xeena), execute:
chmod 755 xeena


Good luck



#!/bin/sh
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
XEENA_HOME=~/java/xeena-1.2
CP="$XEENA_HOME/lib/xmleditor.jar:\
$XEENA_HOME/lib/xerces.jar:\
$XEENA_HOME/lib/jgl3.1.0.jar:\
$XEENA_HOME/lib/xalan.jar:\
$JAVA_HOME/classes.zip"


exec java -cp $CP com.ibm.hrl.xmleditor.Xeena "$@"