We're providing a symlink to the original script, so patch the call to jtreg to correctly handle this situation. --- a/usr/share/java/jtreg/bin/jtreg +++ b/usr/share/java/jtreg/bin/jtreg @@ -68,6 +68,10 @@ Linux ) if grep -qi Microsoft /proc/version ; then wsl=1 ; fi ;; esac +_prog=$0 +_link=`readlink $_prog` +[ -n "$_link" ] && _prog=$_link + # Determine jtreg installation directory JTREG_HOME=${JTREG_HOME:-$JT_HOME} # allow for old version of name if [ -n "$JTREG_HOME" ]; then @@ -81,11 +85,11 @@ # sh, zsh, etc, including on Windows, MKS (ksh), Cygwin (ash or bash) # and Windows Subsystem for Linux (WSL) if type -p type 1>/dev/null 2>&1 && test -z "`type -p type`" ; then - myname=`type -p "$0"` + myname=`type -p "$_prog"` elif type type 1>/dev/null 2>&1 ; then - myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'` + myname=`type "$_prog" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'` elif whence whence 1>/dev/null 2>&1 ; then - myname=`whence "$0"` + myname=`whence "$_prog"` fi mydir=`dirname "$myname"` p=`cd "$mydir" ; pwd` @@ -173,6 +177,6 @@ "${JTREG_JAVA}" \ $javaOpts \ - -Dprogram=`basename "$0"` \ + -Dprogram=`basename "$_prog"` \ -jar "${JTREG_HOME}/lib/jtreg.jar" \ $jtregOpts