1.1 --- a/src/share/bin/launcher.sh-template Fri Jun 26 12:22:40 2009 -0700 1.2 +++ b/src/share/bin/launcher.sh-template Fri Jun 26 18:51:39 2009 -0700 1.3 @@ -1,7 +1,7 @@ 1.4 #!/bin/sh 1.5 1.6 # 1.7 -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. 1.8 +# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. 1.9 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.10 # 1.11 # This code is free software; you can redistribute it and/or modify it 1.12 @@ -44,7 +44,27 @@ 1.13 bcp="$mylib/#PROGRAM#.jar":$cp 1.14 fi 1.15 1.16 -# javac currently assumes that assertions are enabled in the launcher 1.17 +# tools currently assumes that assertions are enabled in the launcher 1.18 ea=-ea:com.sun.tools 1.19 1.20 -"#TARGET_JAVA#" ${bcp:+-Xbootclasspath/p:"$bcp"} ${ea} -jar "${mydir}"/../lib/#PROGRAM#.jar "$@" 1.21 +# Any parameters starting with -J are passed to the JVM. 1.22 +# All other parameters become parameters of #PROGRAM#. 1.23 + 1.24 +# Separate out -J* options for the JVM 1.25 +# Note jdk as possible default to run jtreg 1.26 +# Unset IFS and use newline as arg separator to preserve spaces in args 1.27 +DUALCASE=1 # for MKS: make case statement case-sensitive (6709498) 1.28 +saveIFS="$IFS" 1.29 +nl=' 1.30 +' 1.31 +for i in "$@" ; do 1.32 + IFS= 1.33 + case $i in 1.34 + -J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;; 1.35 + * ) toolOpts=$toolOpts$nl$i ;; 1.36 + esac 1.37 + IFS="$saveIFS" 1.38 +done 1.39 +unset DUALCASE 1.40 + 1.41 +eval "#TARGET_JAVA#" "${bcp:+-Xbootclasspath/p:"$bcp"}" ${ea} ${javaOpts} -jar "${mydir}"/../lib/#PROGRAM#.jar ${toolOpts}