#!/bin/sh
# Script to run JaWavedit on Unix systems.
#
# 1. Commandline options
#    -Dmodule.path=<path> : Specifies an additional path to
#       a directory with modules. e.g.:
#       exec java -Dmodule.path=/usr/local/
#       The directory must be named JWModules, ie
#       /usr/local/JWModules
#    -Dtest.debug=<on | off> : Debug mode on or off. Debug
#       mode will print additional informations and errors
#       to standard out. This might get handy when testing
#       own modules and JaWavedit does not load them correctly.
#    -mx<Size>m : Sets maximum memory that can be used by
#       JaWavedit. Especially when undo is enabled, JaWavedit
#       might need a lot of memory (default: 16 MB).
#       <Size> is in megabytes.
#       Example: set to 48MB: javaw -mx48m JaWavedit %1
# 
# 2. Loading of modules
#    JaWavedit looks for modules (in sub-directory JWModules)
#    in these directories in this order:
#    - module.path when given in command line (see above
#    - $HOME , ie /home/fbomers/, homedir of user
#    - ./ , the path from where jw was executed
#    - the user-defined path (in $HOME/.JaWavedit.conf)
#      this is not implemented yet
#    It loads all valid modules that are found.
#
# 3. Configuration file
#    The configuration file .JaWavedit.conf is stored
#    in the $HOME directory (ie /home/fbomers/.JaWavedit.conf)
#    It shouldn't be modified by hand.
# 
# 4. How to install JaWavedit for multi-user access
#    As an example, let's install JaWavedit to /usr/local/bin/
#    (this should be a directory being in the $PATH of users)
#    First, copy JaWavedit.jar and this file to this directory.
#    Then change both CLASSPATH= lines so that they point to
#    the jar:
#    CLASSPATH=/usr/local/bin/JaWavedit.jar
#    After that, copy the entire JWModules directory (and sub-
#    directories) to where you want it to be, e.g. 
#    /usr/local/JWModules. You should then change the exec
#    line and add the -Dmodule.path= option so that JaWavedit
#    loads automatically these modules by default:
#    exec java -Dmodule.path=/usr/local/ JaWavedit "$@"
#
# 5. Anymore questions ? 
#    mail to: boemers@rumms.uni-mannheim.de
#
if [ -z ${CLASSPATH:=""} ] ; then
	CLASSPATH=.:JaWavedit.jar
else
	CLASSPATH=.:JaWavedit.jar:${CLASSPATH}
fi
export CLASSPATH
exec java JaWavedit "$@"
