#!/bin/sh

#
# source a script that extracts RUNTIME_ARGS and APP_ARGS
#
. `dirname $0`/.extract_args

## [mks] - Check for the DISPLAY variable.  If it is not set, assume
##         the user needs NS_JAVA - which does not need X11.
if [ -z "$DISPLAY" ]
then
    NS_JAVA=true
    export NS_JAVA
fi

progsuffix=
if [ -n "$NS_JAVA" ]
then
    progsuffix=_ns
elif [ -n "$DYN_JAVA" ]
then
    progsuffix=_dyn
fi

#
# Run javakey
#
if [ -f `dirname $0`/java ]
then
  `dirname $0`/java$progsuffix -ms8m $RUNTIME_ARGS sun.security.provider.Main $APP_ARGS
else
  `dirname $0`/jre$progsuffix -ms8m $RUNTIME_ARGS sun.security.provider.Main $APP_ARGS
fi

