# Change the next definition according to your JAVA installation JAVADIR= /usr/local/java #! /bin/sh # # @(#)java_wrapper.sh 1.29 97/05/14 # #=================================================================== # THIS SCRIPT AND JAVA WILL NOT RUN UNDER SUNOS4.X, AKA SOLARIS 1.X. #=================================================================== # Set up default variable values if not supplied by the user. # The default THREADS_TYPE is "green_threads". To change the default change # the setting of the DEFAULT_THREADS_FLAG variable. The only valid values # of that variable are 'green' and 'native'. # # This introduces a dependency of this wrapper on the policy used to do builds. # e.g. the usage of the name "green_threads" here is dependent on the build # scripts which use the same name. Since this is somewhat analogous to the # wrapper already depending on the build scripts putting the executable in # a specific place (JAVA_HOME/bin/${ARCH}), the new dependency does not # seem all that bad. DEFAULT_THREADS_FLAG=green if [ "${THREADS_FLAG:-${DEFAULT_THREADS_FLAG}}" = native ] then THREADS_TYPE=native_threads else THREADS_TYPE=green_threads fi export THREADS_TYPE #echo "Using executables built for $THREADS_TYPE" # # If the -noenv argument is specified, we set JAVA_HOME # and CLASSPATH to nothing, effectively ignoring those # environment variables. # # If one of java's '-*' options was specified on the command line, # then ksh insists on trying to interpret the option when # we do a set. Worse, it swallows the option, refusing # to pass it on to (binary) java. So we keep track of # all options and pass them on to eval by hand. # # Search for '-native' or '-green' flags, and remove them from the # arguments if found. Also if found, set THREADS_TYPE to either # 'native_threads' or 'green_threads', as appropriate. This is an # alternative to using the THREADS_FLAG environment variable to # specify the threads package for Solaris. # On the off chance someone wants to pass -green or -native to # a java program, we stop searching on the first arg that doesn't # start with a runtime-option-specifying hyphen, '-'. # for a in "$@" ; do case $a in -native) THREADS_TYPE=native_threads ;; -green) THREADS_TYPE=green_threads ;; -*) ;; *) break; esac done if [ -z "$JAVA_HOME" ] ; then export JAVA_HOME JAVA_HOME=$JAVADIR fi CLASSPATH="${CLASSPATH-.}" if [ -z "${CLASSPATH}" ] ; then CLASSPATH="$JAVA_HOME/classes:$JAVA_HOME/lib/classes.jar:$JAVA_HOME/lib/rt.jar:$JAVA_HOME/lib/i18n.jar:$JAVA_HOME/lib/classes.zip" else CLASSPATH="$CLASSPATH:$JAVA_HOME/classes:$JAVA_HOME/lib/classes.jar:$JAVA_HOME/lib/rt.jar:$JAVA_HOME/lib/i18n.jar:$JAVA_HOME/lib/classes.zip" fi #CAMILA=/home/fln/camila-prj CLASSPATH="$CLASSPATH:$CAMILA/tlk" export CLASSPATH LD_LIBRARY_PATH="$JAVA_HOME/lib/${ARCH}/$THREADS_TYPE:$LD_LIBRARY_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CAMILA/tlk" export LD_LIBRARY_PATH java camila97