8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
authoralanb
Fri, 11 Jan 2013 20:19:55 +0000
changeset 15254 3997a6f357cb
parent 15253 0b17da070396
child 15255 0b53a05e0b07
8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools Reviewed-by: chegar
jdk/test/ProblemList.txt
jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh
jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
jdk/test/java/io/FileOutputStream/FileOpen.sh
jdk/test/java/io/Serializable/class/run.sh
jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh
jdk/test/java/io/Serializable/maskSyntheticModifier/run.sh
jdk/test/java/io/Serializable/packageAccess/run.sh
jdk/test/java/io/Serializable/resolveClass/consTest/run.sh
jdk/test/java/io/Serializable/resolveClass/deserializeButton/run.sh
jdk/test/java/io/Serializable/superclassDataLoss/run.sh
jdk/test/java/io/Serializable/unnamedPackageSwitch/run.sh
jdk/test/java/lang/Class/getEnclosingClass/build.sh
jdk/test/java/lang/ClassLoader/Assert.sh
jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
jdk/test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh
jdk/test/java/lang/Thread/UncaughtExceptions.sh
jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
jdk/test/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh
jdk/test/java/lang/instrument/AppendToClassPathSetUp.sh
jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh
jdk/test/java/lang/instrument/MakeJAR.sh
jdk/test/java/lang/instrument/MakeJAR2.sh
jdk/test/java/lang/instrument/MakeJAR3.sh
jdk/test/java/lang/instrument/MakeJAR4.sh
jdk/test/java/lang/instrument/ManifestTest.sh
jdk/test/java/lang/instrument/ParallelTransformerLoader.sh
jdk/test/java/lang/instrument/PremainClass/NoPremainAgent.sh
jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh
jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgent.sh
jdk/test/java/lang/instrument/RedefineBigClass.sh
jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh
jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh
jdk/test/java/lang/instrument/RedefineSetUp.sh
jdk/test/java/lang/instrument/RetransformBigClass.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh
jdk/test/java/net/Authenticator/B4933582.sh
jdk/test/java/net/URL/B5086147.sh
jdk/test/java/net/URL/runconstructor.sh
jdk/test/java/net/URLClassLoader/B5077773.sh
jdk/test/java/net/URLClassLoader/closetest/build.sh
jdk/test/java/net/URLClassLoader/getresourceasstream/test.sh
jdk/test/java/net/URLClassLoader/sealing/checksealed.sh
jdk/test/java/net/URLConnection/6212146/test.sh
jdk/test/java/net/URLConnection/UNCTest.sh
jdk/test/java/nio/charset/spi/basic.sh
jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
jdk/test/java/rmi/registry/readTest/readTest.sh
jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
jdk/test/java/security/Security/signedfirst/Dyn.sh
jdk/test/java/security/Security/signedfirst/Static.sh
jdk/test/java/security/cert/CertificateFactory/slowstream.sh
jdk/test/java/util/Formatter/Basic.sh
jdk/test/java/util/Locale/LocaleProviders.sh
jdk/test/java/util/PluggableLocale/ExecTest.sh
jdk/test/java/util/ServiceLoader/basic.sh
jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
jdk/test/java/util/prefs/PrefsSpi.sh
jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh
jdk/test/javax/script/CommonSetup.sh
jdk/test/javax/script/ProviderTest.sh
jdk/test/javax/security/auth/Subject/doAs/Test.sh
jdk/test/lib/security/java.policy/Ext_AllPolicy.sh
jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
jdk/test/sun/net/www/MarkResetTest.sh
jdk/test/sun/net/www/http/HttpClient/RetryPost.sh
jdk/test/sun/net/www/protocol/jar/B5105410.sh
jdk/test/sun/net/www/protocol/jar/jarbug/run.sh
jdk/test/sun/security/krb5/config/dns.sh
jdk/test/sun/security/krb5/runNameEquals.sh
jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
jdk/test/sun/security/pkcs11/KeyStore/Basic.sh
jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh
jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
jdk/test/sun/security/pkcs11/Provider/Login.sh
jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
jdk/test/sun/security/tools/keytool/autotest.sh
jdk/test/sun/security/tools/keytool/printssl.sh
jdk/test/sun/security/tools/keytool/readjar.sh
jdk/test/sun/security/tools/keytool/standard.sh
jdk/test/sun/security/util/Oid/S11N.sh
jdk/test/sun/security/validator/certreplace.sh
jdk/test/sun/security/validator/samedn.sh
jdk/test/tools/launcher/ClassPathWildCard.sh
jdk/test/tools/launcher/MultipleJRE.sh
--- a/jdk/test/ProblemList.txt	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/ProblemList.txt	Fri Jan 11 20:19:55 2013 +0000
@@ -347,6 +347,9 @@
 
 # jdk_util
 
+# 8006090
+java/util/Formatter/Basic.java					generic-all
+
 # Filed 6933803
 java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java  generic-all
 
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -32,15 +32,15 @@
 # @build DumpHeap
 # @run shell DumpHeap.sh
 
-#Set appropriate jdk
-                                                                                
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
+if [ "${TESTJAVA}" = "" ] ; then
      echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
      exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 failed=0
 
 # we use the pid of this shell process to name the heap dump output file.
@@ -50,7 +50,7 @@
     DumpHeap ${DUMPFILE} || exit 2
 
 # check that heap dump is parsable
-${TESTJAVA}/bin/jhat -parseonly true ${DUMPFILE}
+${COMPILEJAVA}/bin/jhat ${TESTTOOLVMOPTS} -parseonly true ${DUMPFILE}
 if [ $? != 0 ]; then failed=1; fi
 
 # dump file is large so remove it
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -30,19 +30,19 @@
 # @run shell GetMaxFileDescriptorCount.sh
 #
 
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
+if [ "${TESTJAVA}" = "" ] ; then
      echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
      exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
 
 runOne()
 { 
    echo "runOne $@"
-   $TESTJAVA/bin/javac -d $TESTCLASSES $TESTSRC/$@.java || exit 2
+   $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d $TESTCLASSES \
+       $TESTSRC/$@.java || exit 2
    $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@        || exit 3
 }
 
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -30,19 +30,18 @@
 # @run shell GetOpenFileDescriptorCount.sh
 #
 
-#Set appropriate jdk
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
+if [ "${TESTJAVA}" = "" ] ; then
      echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
      exit 1
 fi
-
+if [ "${COMPILEJAVA}" = "" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
 runOne()
 { 
    echo "runOne $@"
-   $TESTJAVA/bin/javac -d $TESTCLASSES $TESTSRC/$@.java || exit 2
+   $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d $TESTCLASSES \
+       $TESTSRC/$@.java || exit 2
    $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@        || exit 3
 }
 
--- a/jdk/test/java/io/FileOutputStream/FileOpen.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/FileOutputStream/FileOpen.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -46,8 +46,10 @@
            echo "Could not find the directory-" ${TMP} "- passing test"
 	   exit 0;
 	fi
-	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenPos.java
-	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenNeg.java
+	${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+	    ${TESTSRC}\\FileOpenPos.java
+	${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+	    ${TESTSRC}\\FileOpenNeg.java
 
 	echo "Opening Writable Normal File.."
 	${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenPos ${hfile}
--- a/jdk/test/java/io/Serializable/class/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/class/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -34,17 +34,21 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
 TESTSRC="."
 fi
 
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Test.java
 
 echo Write NonSerial1, Read NonSerial1
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
@@ -52,77 +56,77 @@
 echo Write NonSerial1, Read NonSerial2
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_2.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write NonSerial1, Read Serial1
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write Serial1, Read NonSerial1
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -doe
 echo
 
 echo Write Serial1, Read Serial2
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_2.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write Serial2, Read Serial1
 rm -f A.java     
 cp ${TESTSRC}/SerialA_2.java A.java
-${TESTJAVA}/bin/javac A.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write Serial1, Read Serial3
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_3.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -de
 echo
 
 echo Write Serial3, Read Serial1
 rm -f A.java     
 cp ${TESTSRC}/SerialA_3.java A.java
-${TESTJAVA}/bin/javac A.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
-${TESTJAVA}/bin/javac A.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test -de
 echo
 
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -36,6 +36,10 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
 
 OS=`uname -s`
 # Need to determine the classpath separator and filepath separator based on the
@@ -51,7 +55,7 @@
 esac
 
 JAVA=${TESTJAVA}/bin/java
-JAVAC=${TESTJAVA}/bin/javac
+JAVAC=${COMPILEJAVA}/bin/javac
 MKDIR=mkdir
 RDEL="rm -r"
 
@@ -78,11 +82,14 @@
 
 # Build sources
 set -e
-${JAVAC} -d ${TESTCLASSES}/share ${TESTSRC}/extension/ExtendedObjectInputStream.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/share \
+    ${TESTSRC}/extension/ExtendedObjectInputStream.java
 CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
-${JAVAC} -d ${TESTCLASSES}/oclasses ${TESTSRC}/test/SerialDriver.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/oclasses \
+    ${TESTSRC}/test/SerialDriver.java
 CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
-${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/nclasses \
+    ${TESTSRC}/install/SerialDriver.java
 
 # Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
 CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
--- a/jdk/test/java/io/Serializable/maskSyntheticModifier/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/maskSyntheticModifier/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -29,17 +29,21 @@
 
 if [ "${TESTJAVA}" = "" ]
 then
-	echo "TESTJAVA not set.  Test cannot execute.  Failed."
+    echo "TESTJAVA not set.  Test cannot execute.  Failed."
 exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
-	TESTSRC="."
+    TESTSRC="."
 fi
 
 set -ex
 cp ${TESTSRC}/Foo.class .
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Test.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class
--- a/jdk/test/java/io/Serializable/packageAccess/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/packageAccess/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -29,20 +29,25 @@
 
 if [ "${TESTJAVA}" = "" ]
 then
-	echo "TESTJAVA not set.  Test cannot execute.  Failed."
+    echo "TESTJAVA not set.  Test cannot execute.  Failed."
 exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
-	TESTSRC="."
+    TESTSRC="."
 fi
 
 set -ex
 
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/A.java ${TESTSRC}/B.java \
-    ${TESTSRC}/C.java ${TESTSRC}/D.java ${TESTSRC}/Test.java
-${TESTJAVA}/bin/jar cf foo.jar B.class D.class
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}/A.java ${TESTSRC}/B.java ${TESTSRC}/C.java ${TESTSRC}/D.java \
+    ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf foo.jar B.class D.class
 rm -f B.class D.class
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test
--- a/jdk/test/java/io/Serializable/resolveClass/consTest/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/resolveClass/consTest/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -28,21 +28,26 @@
 
 if [ "${TESTJAVA}" = "" ]
 then
-	echo "TESTJAVA not set.  Test cannot execute.  Failed."
+    echo "TESTJAVA not set.  Test cannot execute.  Failed."
 exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
-	TESTSRC="."
+    TESTSRC="."
 fi
 
 set -ex
 
 rm -f *.class *.jar
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Boot.java
-${TESTJAVA}/bin/jar cf boot.jar *.class
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Boot.java
+${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf boot.jar *.class
 rm -f *.class
-${TESTJAVA}/bin/javac -classpath boot.jar -d . ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath boot.jar -d . \
+    ${TESTSRC}/Test.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbootclasspath/a:boot.jar Test
 rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/resolveClass/deserializeButton/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/resolveClass/deserializeButton/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -30,21 +30,25 @@
 
 if [ "${TESTJAVA}" = "" ]
 then
-	echo "TESTJAVA not set.  Test cannot execute.  Failed."
+    echo "TESTJAVA not set.  Test cannot execute.  Failed."
 exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
-	TESTSRC="."
+    TESTSRC="."
 fi
 
 set -ex
 
 rm -f *.class *.jar
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Foo.java
-${TESTJAVA}/bin/jar cf cb.jar *.class
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Foo.java
+${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf cb.jar *.class
 rm -f *.class
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Test.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/superclassDataLoss/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/superclassDataLoss/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -29,22 +29,28 @@
 
 if [ "${TESTJAVA}" = "" ]
 then
-	echo "TESTJAVA not set.  Test cannot execute.  Failed."
+    echo "TESTJAVA not set.  Test cannot execute.  Failed."
 exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
-	TESTSRC="."
+    TESTSRC="."
 fi
 
 set -ex
 
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/A.java ${TESTSRC}/B.java
-${TESTJAVA}/bin/jar cf cb1.jar A.class B.class
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}/A.java ${TESTSRC}/B.java
+${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf cb1.jar A.class B.class
 cp cb1.jar cb2.jar
 rm -f A.class B.class
 
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}/Test.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/unnamedPackageSwitch/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/io/Serializable/unnamedPackageSwitch/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -29,16 +29,21 @@
 
 if [ "${TESTJAVA}" = "" ]
 then
-	echo "TESTJAVA not set.  Test cannot execute.  Failed."
+    echo "TESTJAVA not set.  Test cannot execute.  Failed."
 exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
-	TESTSRC="."
+    TESTSRC="."
 fi
 
 set -ex
 
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/A.java ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}/A.java ${TESTSRC}/Test.java
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test
--- a/jdk/test/java/lang/Class/getEnclosingClass/build.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/Class/getEnclosingClass/build.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,5 +37,6 @@
         ;;
 esac
 
-JAVAC=${TESTJAVA}/bin/javac
-${JAVAC} -d ${TESTCLASSES} -sourcepath ${TESTSRC}${SEP}. ${TESTSRC}/EnclosingClassTest.java
+JAVAC=${COMPILEJAVA}/bin/javac
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES} -sourcepath ${TESTSRC}${SEP}. \
+    ${TESTSRC}/EnclosingClassTest.java
--- a/jdk/test/java/lang/ClassLoader/Assert.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/ClassLoader/Assert.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -35,6 +35,10 @@
   exit 1
 fi
 echo "TESTJAVA=${TESTJAVA}"
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
@@ -47,7 +51,7 @@
 cp -R ${TESTSRC}/package1 .
 cp -R ${TESTSRC}/package2 .
 
-${TESTJAVA}/bin/javac Assert.java 
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} Assert.java 
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Assert
 
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -42,6 +42,10 @@
     exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-specific variables
 OS=`uname -s`
 case "$OS" in
@@ -69,7 +73,7 @@
 echo ""
 
 # compile test
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -d ${TESTCLASSES} \
         ${TESTSRC}${FS}Starter.java ${TESTSRC}${FS}DelegatingLoader.java
 
@@ -80,7 +84,7 @@
 fi
 
 # set up test
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -d ${TESTCLASSES}${FS} \
         ${TESTSRC}${FS}Alice.java ${TESTSRC}${FS}SupBob.java \
         ${TESTSRC}${FS}Bob.java ${TESTSRC}${FS}SupAlice.java
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -41,9 +41,14 @@
     echo "FAILED!!!"
     exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ] ; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo COMPILEJAVA=${COMPILEJAVA}
 echo ""
 
 # set platform-specific variables
@@ -64,7 +69,7 @@
 esac
 
 # compile test
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -d ${TESTCLASSES} \
         ${TESTSRC}${FS}Starter.java ${TESTSRC}${FS}DelegatingLoader.java
 
@@ -75,7 +80,7 @@
 fi
 
 # set up test
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -d ${TESTCLASSES}${FS} \
         ${TESTSRC}${FS}Alice.java ${TESTSRC}${FS}SupBob.java \
         ${TESTSRC}${FS}Bob.java ${TESTSRC}${FS}SupAlice.java
--- a/jdk/test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/System/MacJNUEncoding/MacJNUEncoding.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -44,6 +44,11 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -56,11 +61,11 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 echo "Building test classes..."
-"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/ExpectedEncoding.java 
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/ExpectedEncoding.java 
 
 echo ""
 echo "Running test for C locale"
--- a/jdk/test/java/lang/Thread/UncaughtExceptions.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/Thread/UncaughtExceptions.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -34,7 +34,7 @@
 # To run this test manually, simply do ./UncaughtExceptions.sh
 
  java="${TESTJAVA+${TESTJAVA}/bin/}java"
-javac="${TESTJAVA+${TESTJAVA}/bin/}javac"
+javac="${COMPILEJAVA+${COMPILEJAVA}/bin/}javac"
 
 failed=""
 Fail() { echo "FAIL: $1"; failed="${failed}."; }
@@ -121,7 +121,7 @@
 }
 EOJAVA
 
-    Sys "$javac" "Seppuku.java"
+    Sys "$javac" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} "Seppuku.java"
     CheckCommandResults "$expectedRC" "$expectedOut" "$expectedErr" \
 	"$java" "Seppuku"
     Cleanup
--- a/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -33,6 +33,10 @@
   exit 1
 fi
 echo "TESTJAVA=${TESTJAVA}"
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
@@ -67,8 +71,8 @@
 
 mkdir -p classes
 cp ${TESTSRC}${FS}*.java .
-${TESTJAVA}${FS}bin${FS}javac -d classes A.java B.java C.java
-${TESTJAVA}${FS}bin${FS}javac Main.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d classes A.java B.java C.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} Main.java
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main
 result=$?
 if [ $result -eq 0 ]
--- a/jdk/test/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -42,6 +42,12 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
@@ -51,7 +57,7 @@
 echo "TESTCLASSES=${TESTCLASSES}"
 echo "CLASSPATH=${CLASSPATH}"
 
-JAVAC="${TESTJAVA}/bin/javac -g"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
 
 mkdir -p hidden
 mv ${TESTCLASSES}/ExampleForBootClassPath.class hidden
--- a/jdk/test/java/lang/instrument/AppendToClassPathSetUp.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/AppendToClassPathSetUp.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -42,6 +42,12 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
@@ -51,10 +57,10 @@
 echo "TESTCLASSES=${TESTCLASSES}"
 echo "CLASSPATH=${CLASSPATH}"
 
-JAVAC="${TESTJAVA}/bin/javac -g"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
 
 cp ${TESTSRC}/ExampleForClassPath.java ExampleForClassPath.java
-${JAVAC} ExampleForClassPath.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleForClassPath.java
 mkdir -p hidden
 mv ExampleForClassPath.class hidden
 rm -f ExampleForClassPath.java
--- a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -34,6 +34,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -46,30 +52,32 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
-JAR="${TESTJAVA}"/bin/jar
+JAR="${COMPILEJAVA}"/bin/jar
 
 echo "Creating manifest file..."
 
-"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/Setup.java
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/Setup.java
 
 # java Setup <workdir> <premain-class>
 # - outputs boot class path to boot.dir
 
-"$JAVA" -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent
+"$JAVA" ${TESTVMOPTS} -classpath "${TESTCLASSES}" Setup "${TESTCLASSES}" Agent
 BOOTDIR=`cat ${TESTCLASSES}/boot.dir`
 
 echo "Created ${BOOTDIR}"
 
 echo "Building test classes..."
 
-"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/Agent.java "${TESTSRC}"/DummyMain.java
-"$JAVAC" -d "${BOOTDIR}" "${TESTSRC}"/AgentSupport.java
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" \
+    "${TESTSRC}"/Agent.java "${TESTSRC}"/DummyMain.java
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${BOOTDIR}" \
+    "${TESTSRC}"/AgentSupport.java
 
 echo "Creating agent jar file..."
 
-"$JAR" -cvfm "${TESTCLASSES}"/Agent.jar "${TESTCLASSES}"/MANIFEST.MF \
+"$JAR" ${TESTTOOLVMOPTS} -cvfm "${TESTCLASSES}"/Agent.jar "${TESTCLASSES}"/MANIFEST.MF \
     -C "${TESTCLASSES}" Agent.class || exit 1
 
 echo "Running test..."
@@ -79,7 +87,8 @@
 
 echo "Cleanup..."
 
-"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/Cleanup.java
-"$JAVA" -classpath "${TESTCLASSES}" Cleanup "${BOOTDIR}"
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" \
+    "${TESTSRC}"/Cleanup.java
+"$JAVA" ${TESTTOOLVMOPTS} -classpath "${TESTCLASSES}" Cleanup "${BOOTDIR}"
 
 exit $result
--- a/jdk/test/java/lang/instrument/MakeJAR.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/MakeJAR.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -23,7 +23,6 @@
 # questions.
 #
 
-
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -38,16 +37,22 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
   exit 1
 fi
 
-JAVAC="${TESTJAVA}/bin/javac -g"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
+JAR="${COMPILEJAVA}/bin/jar"
 
 cp ${TESTSRC}/InstrumentationHandoff.java InstrumentationHandoff.java
-${JAVAC} InstrumentationHandoff.java
-${JAR} cvfm $1.jar ${TESTSRC}/$1.mf InstrumentationHandoff.class
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} InstrumentationHandoff.java
+${JAR} ${TESTTOOLVMOPTS} cvfm $1.jar ${TESTSRC}/$1.mf InstrumentationHandoff.class
 rm -f InstrumentationHandoff.class InstrumentationHandoff.java
--- a/jdk/test/java/lang/instrument/MakeJAR2.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/MakeJAR2.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -41,6 +41,12 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
@@ -64,8 +70,8 @@
       ;;
 esac
 
-JAVAC="${TESTJAVA}/bin/javac -g"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
+JAR="${COMPILEJAVA}/bin/jar"
 
 cp ${TESTSRC}/${AGENT}.java .
 cp ${TESTSRC}/${APP}.java .
@@ -77,11 +83,11 @@
 cp ${TESTSRC}/bootreporter/*.java bootpath/bootreporter
 
 cd bootpath
-${JAVAC} bootreporter/*.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} bootreporter/*.java
 cd ..
 
-${JAVAC} ${AGENT}.java ilib/*.java
-${JAVAC} -classpath .${PATHSEP}bootpath ${APP}.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${AGENT}.java ilib/*.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath .${PATHSEP}bootpath ${APP}.java
 
 echo "Manifest-Version: 1.0"    >  ${AGENT}.mf
 echo Premain-Class: ${AGENT} >> ${AGENT}.mf
@@ -92,6 +98,6 @@
   shift
 done
 
-${JAR} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ilib/*.class
+${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ilib/*.class
 
 # rm -rf  ${AGENT}.java ilib ${AGENT}.mf ${AGENT}*.class
--- a/jdk/test/java/lang/instrument/MakeJAR3.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/MakeJAR3.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -39,17 +39,23 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
   exit 1
 fi
 
-JAVAC="${TESTJAVA}/bin/javac -g"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
+JAR="${COMPILEJAVA}/bin/jar"
 
 cp ${TESTSRC}/${AGENT}.java .
-${JAVAC} ${AGENT}.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${AGENT}.java
 
 echo "Manifest-Version: 1.0"    >  ${AGENT}.mf
 echo Premain-Class: ${AGENT} >> ${AGENT}.mf
@@ -60,4 +66,4 @@
 done
 
 
-${JAR} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class
+${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class
--- a/jdk/test/java/lang/instrument/MakeJAR4.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/MakeJAR4.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -17,17 +17,23 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
   exit 1
 fi
 
-JAVAC="${TESTJAVA}/bin/javac -g"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
+JAR="${COMPILEJAVA}/bin/jar"
 
 cp ${TESTSRC}/${AGENT}.java ${TESTSRC}/${OTHER}.java .
-${JAVAC} ${AGENT}.java ${OTHER}.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${AGENT}.java ${OTHER}.java
 
 echo "Manifest-Version: 1.0"    >  ${AGENT}.mf
 echo Premain-Class: ${AGENT} >> ${AGENT}.mf
@@ -37,4 +43,4 @@
 done
 
 
-${JAR} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ${OTHER}*.java
+${JAR} "{TESTTOOLVMOPTS}" cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ${OTHER}*.java
--- a/jdk/test/java/lang/instrument/ManifestTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/ManifestTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -312,7 +312,7 @@
     fi
 
     rm -f ${AGENT}.jar
-    ${JAR} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}.class
+    ${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}.class
 
     echo "$expect_boot_cp_line" > expect_boot_cp_line
     echo "$expect_redef_line"   > expect_redef_line
@@ -326,6 +326,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -338,8 +344,8 @@
   exit 1
 fi
 
-JAR="${TESTJAVA}/bin/jar"
-JAVAC="${TESTJAVA}"/bin/javac
+JAR="${COMPILEJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 # Now that ManifestTestApp.class is built, we move
@@ -353,7 +359,7 @@
 # so we can tell when the wrong version is run
 sed 's/return 15/return 42/' "${TESTSRC}"/ExampleForBootClassPath.java \
     > ExampleForBootClassPath.java
-"$JAVAC" ExampleForBootClassPath.java
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleForBootClassPath.java
 mv ExampleForBootClassPath.class \
     $OUT_OF_THE_WAY/ExampleForBootClassPath.class.bad
 mv ExampleForBootClassPath.java \
@@ -363,7 +369,7 @@
 # We compile the agent in the working directory instead of with
 # a build task because we construct a different agent JAR file
 # for each test case.
-${JAVAC} -d . ${TESTSRC}/${AGENT}.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/${AGENT}.java
 
 FAIL_MARKER=fail_marker
 rm -f $FAIL_MARKER
--- a/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -38,6 +38,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -50,16 +56,16 @@
   exit 1
 fi
 
-JAR="${TESTJAVA}"/bin/jar
-JAVAC="${TESTJAVA}"/bin/javac
+JAR="${COMPILEJAVA}"/bin/jar
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
-"${JAVAC}" -d . \
+"${JAVAC}"  ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d .\
     "${TESTSRC}"/TestClass1.java \
     "${TESTSRC}"/TestClass2.java \
     "${TESTSRC}"/TestClass3.java
 
-"${JAR}" cvf Test.jar Test*.class
+"${JAR}" ${TESTTOOLVMOPTS} cvf Test.jar Test*.class
 # Removing the test class files is important. If these
 # .class files are available on the classpath other
 # than via Test.jar, then the deadlock will not reproduce.
--- a/jdk/test/java/lang/instrument/PremainClass/NoPremainAgent.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/PremainClass/NoPremainAgent.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,6 +37,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -49,7 +55,7 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 "${JAVA}" ${TESTVMOPTS} -javaagent:NoPremainAgent.jar \
--- a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -32,6 +32,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -44,10 +50,10 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
-"$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/DummyMain.java
+"$JAVAC" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}"/DummyMain.java
 
 "${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTSRC}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
 result=$?
--- a/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgent.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgent.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,6 +37,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -49,7 +55,7 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 "${JAVA}" ${TESTVMOPTS} -javaagent:ZeroArgPremainAgent.jar \
--- a/jdk/test/java/lang/instrument/RedefineBigClass.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/RedefineBigClass.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,6 +37,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -49,7 +55,7 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 "${JAVA}" ${TESTVMOPTS} \
--- a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,6 +37,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -49,7 +55,7 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 "${JAVA}" ${TESTVMOPTS} \
--- a/jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,6 +37,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -49,18 +55,18 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 cp "${TESTSRC}"/RedefineMethodAddInvokeTarget_1.java \
     RedefineMethodAddInvokeTarget.java
-"${JAVAC}" -d . RedefineMethodAddInvokeTarget.java
+"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodAddInvokeTarget.java
 mv RedefineMethodAddInvokeTarget.java RedefineMethodAddInvokeTarget_1.java
 mv RedefineMethodAddInvokeTarget.class RedefineMethodAddInvokeTarget_1.class
 
 cp "${TESTSRC}"/RedefineMethodAddInvokeTarget_2.java \
     RedefineMethodAddInvokeTarget.java
-"${JAVAC}" -d . RedefineMethodAddInvokeTarget.java
+"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . RedefineMethodAddInvokeTarget.java
 mv RedefineMethodAddInvokeTarget.java RedefineMethodAddInvokeTarget_2.java
 mv RedefineMethodAddInvokeTarget.class RedefineMethodAddInvokeTarget_2.class
 
--- a/jdk/test/java/lang/instrument/RedefineSetUp.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/RedefineSetUp.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -41,6 +41,12 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
@@ -50,15 +56,15 @@
 echo "TESTCLASSES=${TESTCLASSES}"
 echo "CLASSPATH=${CLASSPATH}"
 
-JAVAC="${TESTJAVA}/bin/javac -g"
+JAVAC="${COMPILEJAVA}/bin/javac -g"
 
 cp ${TESTSRC}/Different_ExampleRedefine.java ExampleRedefine.java
 cp ${TESTSRC}/Counter.java .
-${JAVAC} ExampleRedefine.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleRedefine.java
 mv ExampleRedefine.class Different_ExampleRedefine.class
 rm -f ExampleRedefine.java Counter.java
 
 cp ${TESTSRC}/ExampleRedefine.java ExampleRedefine.java
 cp ${TESTSRC}/Counter.java .
-${JAVAC} ExampleRedefine.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ExampleRedefine.java
 rm -f ExampleRedefine.java Counter.java
--- a/jdk/test/java/lang/instrument/RetransformBigClass.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/RetransformBigClass.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -38,6 +38,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -50,7 +56,7 @@
   exit 1
 fi
 
-JAVAC="${TESTJAVA}"/bin/javac
+JAVAC="${COMPILEJAVA}"/bin/javac
 JAVA="${TESTJAVA}"/bin/java
 
 "${JAVA}" ${TESTVMOPTS} \
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -34,6 +34,11 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
 . ${TESTSRC}/CommonSetup.sh
 
 # Setup to create circularity condition
@@ -44,9 +49,9 @@
 cp "${TESTSRC}"/A.1 "${TESTCLASSES}"/A.java
 cp "${TESTSRC}"/B.1 "${TESTCLASSES}"/B.java
 (cd "${TESTCLASSES}"; \
-    $JAVAC A.java B.java; \
-    $JAVAC -d . "${TESTSRC}"/CircularityErrorTest.java; \
-    $JAR cf A.jar A.class; \
+    $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java B.java; \
+    $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . "${TESTSRC}"/CircularityErrorTest.java; \
+    $JAR ${TESTTOOLVMOPTS} cf A.jar A.class; \
     rm -f A.class; mv B.class B.keep)
 
 # A extends B
@@ -55,7 +60,7 @@
 cp "${TESTSRC}"/A.2 "${TESTCLASSES}"/A.java
 cp "${TESTSRC}"/B.2 "${TESTCLASSES}"/B.java
 (cd "${TESTCLASSES}"; \
-     $JAVAC A.java B.java; rm -f B.class A.java B.java)
+     $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} A.java B.java; rm -f B.class A.java B.java)
 
 # Move B.keep to B.class creates the A extends B and
 # B extends A condition.
@@ -67,7 +72,7 @@
 echo "Premain-Class: CircularityErrorTest" > "${MANIFEST}"
 
 # Setup test case as an agent
-$JAR -cfm "${TESTCLASSES}"/CircularityErrorTest.jar "${MANIFEST}" \
+$JAR ${TESTTOOLVMOPTS} -cfm "${TESTCLASSES}"/CircularityErrorTest.jar "${MANIFEST}" \
   -C "${TESTCLASSES}" CircularityErrorTest.class
 
 # Finally we run the test
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -65,7 +65,8 @@
 echo "public class Bar { }" > "${BAR}"
 
 (cd "${OTHERDIR}"; \
-  $JAVAC Foo.java Bar.java; $JAR cf "${OTHERDIR}"/Bar.jar Bar.class; \
+  $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} Foo.java Bar.java; \
+  $JAR ${TESTTOOLVMOPTS} cf "${OTHERDIR}"/Bar.jar Bar.class; \
   rm -f Bar.class)
 
 # Create the manifest
@@ -74,7 +75,7 @@
 echo "Premain-Class: ClassUnloadTest" > "${MANIFEST}"
 
 # Setup test case as an agent
-$JAR -cfm "${TESTCLASSES}"/ClassUnloadTest.jar "${MANIFEST}" \
+$JAR ${TESTTOOLVMOPTS} -cfm "${TESTCLASSES}"/ClassUnloadTest.jar "${MANIFEST}" \
   -C "${TESTCLASSES}" ClassUnloadTest.class
 
 # Finally we run the test
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -70,6 +70,12 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -83,6 +89,6 @@
 fi
 
 JAVA="${TESTJAVA}/bin/java"
-JAVAC="${TESTJAVA}/bin/javac"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac"
+JAR="${COMPILEJAVA}/bin/jar"
 
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -47,10 +47,10 @@
 
 cd ${TESTCLASSES}
 
-"$JAR" -cfm Agent.jar "${TESTSRC}"/manifest.mf Agent.class
-"$JAR" -cf  AgentSupport.jar AgentSupport.class
-"$JAR" -cf  BootSupport.jar BootSupport.class
-"$JAR" -cf  SimpleTests.jar BasicTest.class PrematureLoadTest.class
+"$JAR" ${TESTTOOLVMOPTS} -cfm Agent.jar "${TESTSRC}"/manifest.mf Agent.class
+"$JAR" ${TESTTOOLVMOPTS} -cf  AgentSupport.jar AgentSupport.class
+"$JAR" ${TESTTOOLVMOPTS} -cf  BootSupport.jar BootSupport.class
+"$JAR" ${TESTTOOLVMOPTS} -cf  SimpleTests.jar BasicTest.class PrematureLoadTest.class
 
 failures=0
 
@@ -72,18 +72,18 @@
 # system class path
 
 mkdir tmp
-"${JAVAC}" -d tmp "${TESTSRC}"/Tracer.java
-(cd tmp; "${JAR}" cf ../Tracer.jar org/tools/Tracer.class)
+"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d tmp "${TESTSRC}"/Tracer.java
+(cd tmp; "${JAR}" ${TESTTOOLVMOPTS} cf ../Tracer.jar org/tools/Tracer.class)
 
 # InstrumentedApplication is Application+instrmentation - don't copy as
 # we don't want the original file permission
 
 cat "${TESTSRC}"/InstrumentedApplication.java > ./Application.java
-"${JAVAC}" -classpath Tracer.jar -d . Application.java
+"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath Tracer.jar -d . Application.java
 mv Application.class InstrumentedApplication.bytes
 
 cp "${TESTSRC}"/Application.java .
-"${JAVAC}" -d . Application.java
+"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . Application.java
 
 sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
--- a/jdk/test/java/net/Authenticator/B4933582.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/Authenticator/B4933582.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,7 +43,8 @@
     exit 1;
     ;;
 esac
-${TESTJAVA}${FS}bin${FS}javac -d . -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest" ${TESTSRC}${FS}B4933582.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest" ${TESTSRC}${FS}B4933582.java
 rm -f cache.ser auth.save
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 first
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 second
--- a/jdk/test/java/net/URL/B5086147.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URL/B5086147.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -42,7 +42,7 @@
     exit 1;
     ;;
 esac
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5086147.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}B5086147.java
 
 failures=0
 
--- a/jdk/test/java/net/URL/runconstructor.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URL/runconstructor.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -44,7 +44,8 @@
     exit 1;
     ;;
 esac
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}Constructor.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}${FS}Constructor.java
 
 failures=0
 
--- a/jdk/test/java/net/URLClassLoader/B5077773.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URLClassLoader/B5077773.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -58,7 +58,8 @@
 
 cp ${TESTSRC}${FS}foo.jar .
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5077773.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}${FS}B5077773.java
 
 WD=`pwd`
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5077773
--- a/jdk/test/java/net/URLClassLoader/closetest/build.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URLClassLoader/closetest/build.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -40,14 +40,19 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
   exit 1
 fi
 
-JAVAC="${TESTJAVA}/bin/javac"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac"
+JAR="${COMPILEJAVA}/bin/jar"
 
 rm -rf ${TESTCLASSES}/test1
 rm -rf ${TESTCLASSES}/test2
@@ -59,15 +64,15 @@
 cd ${TESTSRC}/test1/com/foo
 cp * ${TESTCLASSES}/test1/com/foo
 cd ${TESTCLASSES}/test1
-${JAVAC} com/foo/*.java
-${JAR} cvf ../test1.jar com/foo/*.class com/foo/Resource*
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} com/foo/*.java
+${JAR} ${TESTTOOLVMOPTS} cvf ../test1.jar com/foo/*.class com/foo/Resource*
 
 cd ${TESTSRC}/test2/com/foo
 cp * ${TESTCLASSES}/test2/com/foo
 cd ${TESTCLASSES}/test2
-${JAVAC} com/foo/*.java
-${JAR} cvf ../test2.jar com/foo/*.class com/foo/Resource*
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} com/foo/*.java
+${JAR} ${TESTTOOLVMOPTS} cvf ../test2.jar com/foo/*.class com/foo/Resource*
 
 cp ${TESTSRC}/serverRoot/Test.java ${TESTCLASSES}/serverRoot
 cd ${TESTCLASSES}/serverRoot
-${JAVAC} Test.java
+${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} Test.java
--- a/jdk/test/java/net/URLClassLoader/getresourceasstream/test.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URLClassLoader/getresourceasstream/test.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,7 +43,7 @@
     fi
 }
 
-${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}/Test.java
 cp ${TESTSRC}/test.jar .
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} Test
--- a/jdk/test/java/net/URLClassLoader/sealing/checksealed.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URLClassLoader/sealing/checksealed.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -51,11 +51,13 @@
 
 
 if [ x"$TESTJAVA" = x ]; then TESTJAVA=$1; fi
+if [ x"$COMPILEJAVA" = x ]; then COMPILEJAVA=$1; fi
 if [ x"$TESTSRC" = x ]; then TESTSRC=.; fi
 
 CLASSPATH=".${PS}${TESTSRC}${FS}a${PS}${TESTSRC}${FS}b.jar"
 
-${TESTJAVA}${FS}bin${FS}javac -classpath "${CLASSPATH}" -d . ${TESTSRC}${FS}CheckSealed.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath "${CLASSPATH}" -d . \
+    ${TESTSRC}${FS}CheckSealed.java
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp "${CLASSPATH}" CheckSealed 1
 if [ $? != 0 ]; then exit 1; fi
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp "${CLASSPATH}" CheckSealed 2
--- a/jdk/test/java/net/URLConnection/6212146/test.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URLConnection/6212146/test.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -63,7 +63,7 @@
 
 cp ${TESTSRC}${FS}test.jar  jars
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}Test.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}Test.java
 
 WD=`pwd`
 ulimit -H -n 300
--- a/jdk/test/java/net/URLConnection/UNCTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/net/URLConnection/UNCTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -35,7 +35,7 @@
 OS=`uname -s`
 case "$OS" in
     Windows_95 | Windows_98 | Windows_NT )
-	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\UNCTest.java
+	${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}\\UNCTest.java
 	${TESTJAVA}/bin/java ${TESTVMOPTS} UNCTest ${UNC}
 	exit
         ;;
--- a/jdk/test/java/nio/charset/spi/basic.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/nio/charset/spi/basic.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -38,12 +38,13 @@
 if [ -z "$TESTJAVA" ]; then
   if [ $# -lt 1 ]; then exit 1; fi
   TESTJAVA=$1; shift
+  COMPILEJDK="${TESTJAVA}"
   TESTSRC=`pwd`
   TESTCLASSES=`pwd`
 fi
 
 JAVA=$TESTJAVA/bin/java
-JAR=$TESTJAVA/bin/jar
+JAR=$COMPILEJAVA/bin/jar
 
 DIR=`pwd`
 case `uname` in
@@ -72,7 +73,7 @@
     cp $TESTCLASSES/FooProvider.class $TESTCLASSES/FooCharset.class $JARD
     mkdir $TESTD
     cp $TESTCLASSES/Test.class $TESTD
-    (cd $JARD; $JAR -cf $EXTD/test.jar *)
+    (cd $JARD; $JAR ${TESTTOOLVMOPTS} -cf $EXTD/test.jar *)
 fi
 
 if [ $# -gt 0 ]; then
--- a/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -49,7 +49,7 @@
 for dir in `echo ${TESTCLASSPATH:-$TESTCLASSES} | sed -e "s/$PS/ /"` ; do cp $dir/*.class classes ; done
 rm classes/ExtLoadedImpl.class classes/ExtLoadedImpl_Stub.class classes/CheckLoader.class
 mkdir -p ext
-$TESTJAVA/bin/jar cf ext/ext.jar -C $TESTCLASSES ExtLoadedImpl.class -C $TESTCLASSES ExtLoadedImpl_Stub.class -C $TESTCLASSES CheckLoader.class
+$COMPILEJAVA/bin/jar ${TESTTOOLVMOPTS} cf ext/ext.jar -C $TESTCLASSES ExtLoadedImpl.class -C $TESTCLASSES ExtLoadedImpl_Stub.class -C $TESTCLASSES CheckLoader.class
 
 $TESTJAVA/bin/java ${TESTVMOPTS} -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest
 
--- a/jdk/test/java/rmi/registry/readTest/readTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/rmi/registry/readTest/readTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -53,15 +53,15 @@
 
 TEST_CLASSPATH=.$PS${TESTCLASSPATH:-$TESTCLASSES}
 cp -r ${TESTSRC}${FS}* .
-${TESTJAVA}${FS}bin${FS}javac testPkg${FS}*java
-${TESTJAVA}${FS}bin${FS}javac -cp $TEST_CLASSPATH readTest.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} testPkg${FS}*java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -cp $TEST_CLASSPATH readTest.java
 
 mkdir rmi_tmp
 RMIREG_OUT=rmi.out
 #start rmiregistry without any local classes on classpath
 cd rmi_tmp
 # NOTE: This RMI Registry port must match TestLibrary.READTEST_REGISTRY_PORT
-${TESTJAVA}${FS}bin${FS}rmiregistry 64005 > ..${FS}${RMIREG_OUT} 2>&1 &
+${TESTJAVA}${FS}bin${FS}rmiregistry ${TESTTOOLVMOPTS} 64005 > ..${FS}${RMIREG_OUT} 2>&1 &
 RMIREG_PID=$!
 # allow some time to start
 sleep 3
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,6 +43,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+   COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -78,11 +82,11 @@
 fi
 
 # compile the test program
-${TESTJAVA}${FILESEP}bin${FILESEP}javac \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -d ${TESTCLASSES}${FILESEP} \
         ${TESTSRC}${FILESEP}ClassLoaderDeadlock.java
 
-${TESTJAVA}${FILESEP}bin${FILESEP}javac \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -d ${TESTCLASSES}${FILESEP}provider${FILESEP} \
         ${TESTSRC}${FILESEP}provider${FILESEP}HashProvider.java
 
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -47,6 +47,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+   COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -88,12 +92,12 @@
 fi
 
 # compile and package the test program
-${TESTJAVA}${FILESEP}bin${FILESEP}javac \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
     -d ${TESTCLASSES} \
     ${TESTSRC}${FILESEP}CreateSerialized.java \
     ${TESTSRC}${FILESEP}Deadlock2.java
 
-${TESTJAVA}${FILESEP}bin${FILESEP}jar \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}jar ${TESTTOOLVMOPTS} \
     -cvf testlib${FILESEP}Deadlock2.jar \
     Deadlock2*.class
 
--- a/jdk/test/java/security/Security/signedfirst/Dyn.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/security/Security/signedfirst/Dyn.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,6 +43,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+   COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -77,7 +81,7 @@
 rm DynSignedProvFirst.class
 
 # compile the test program
-${TESTJAVA}${FILESEP}bin${FILESEP}javac \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FILESEP}exp.jar \
         -d ${TESTCLASSES}${FILESEP} \
         ${TESTSRC}${FILESEP}DynSignedProvFirst.java
--- a/jdk/test/java/security/Security/signedfirst/Static.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/security/Security/signedfirst/Static.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,6 +43,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+   COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -77,7 +81,7 @@
 rm StaticSignedProvFirst.class
 
 # compile the test program
-${TESTJAVA}${FILESEP}bin${FILESEP}javac \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}exp.jar" \
         -d ${TESTCLASSES}${FILESEP} \
         ${TESTSRC}${FILESEP}StaticSignedProvFirst.java
--- a/jdk/test/java/security/cert/CertificateFactory/slowstream.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/security/cert/CertificateFactory/slowstream.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -33,6 +33,9 @@
   echo "FAILED!!!"
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 
 # set platform-dependent variables
 OS=`uname -s`
@@ -45,6 +48,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}SlowStream.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+        ${TESTSRC}${FS}SlowStream.java
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=${TESTSRC} SlowStreamWriter | \
         ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} SlowStreamReader
--- a/jdk/test/java/util/Formatter/Basic.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/util/Formatter/Basic.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -23,7 +23,8 @@
 
 #
 
-${TESTJAVA}/bin/javac -cp ${TESTSRC} -d . ${TESTSRC}/Basic.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -cp ${TESTSRC} -d . \
+    ${TESTSRC}/Basic.java
 
 expectPass() {
   if [ $1 -eq 0 ]
@@ -38,7 +39,7 @@
   echo "Testing:" ${1}
   TZ="${1}"; export TZ
   echo "  " $TZ
-  ${TESTJAVA}/bin/java Basic
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} Basic
   expectPass $?
 }
 
--- a/jdk/test/java/util/Locale/LocaleProviders.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/util/Locale/LocaleProviders.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -39,6 +39,10 @@
   echo "TESTJAVA not set.  Test cannot execute.  Failed."
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 echo "TESTJAVA=${TESTJAVA}"
 if [ "${TESTCLASSES}" = "" ]
 then
@@ -92,8 +96,9 @@
 mk ${SPIDIR}${FS}dest${FS}META-INF${FS}services${FS}java.util.spi.TimeZoneNameProvider << EOF
 tznp
 EOF
-${TESTJAVA}${FS}bin${FS}javac -d ${SPIDIR}${FS}dest ${SPIDIR}${FS}src${FS}tznp.java
-${TESTJAVA}${FS}bin${FS}jar cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${SPIDIR}${FS}dest \
+    ${SPIDIR}${FS}src${FS}tznp.java
+${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
 
 # get the platform default locales
 PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
--- a/jdk/test/java/util/PluggableLocale/ExecTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/util/PluggableLocale/ExecTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -46,6 +46,10 @@
   echo "TESTJAVA not set.  Test cannot execute.  Failed."
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 echo "TESTJAVA=${TESTJAVA}"
 if [ "${TESTCLASSES}" = "" ]
 then
@@ -99,7 +103,8 @@
 # compile
 cp ${TESTSRC}${FS}ProviderTest.java .
 cp ${TESTSRC}${FS}$2.java .
-COMPILE="${TESTJAVA}${FS}bin${FS}javac -XDignore.symbol.file -d . -classpath ${CLASSPATHARG} $2.java"
+COMPILE="${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
+    -XDignore.symbol.file -d . -classpath ${CLASSPATHARG} $2.java"
 echo ${COMPILE}
 ${COMPILE}
 result=$?
--- a/jdk/test/java/util/ServiceLoader/basic.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/util/ServiceLoader/basic.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -33,12 +33,13 @@
 if [ -z "$TESTJAVA" ]; then
   if [ $# -lt 1 ]; then exit 1; fi
   TESTJAVA="$1"; shift
+  COMPILEJAVA="${TESTJAVA}"
   TESTSRC="`pwd`"
   TESTCLASSES="`pwd`"
 fi
 
 JAVA="$TESTJAVA/bin/java"
-JAR="$TESTJAVA/bin/jar"
+JAR="$COMPILEJAVA/bin/jar"
 
 OS=`uname -s`
 case "$OS" in
@@ -68,7 +69,7 @@
       if [ $n = 3 ]; then
         cp $TESTCLASSES/FooService.class $JARD
       fi
-      (cd $JARD; "$JAR" -cf ../p$n.jar *)
+      (cd $JARD; "$JAR" ${TESTTOOLVMOPTS} -cf ../p$n.jar *)
     done
 
     mv p3.jar $EXTD
--- a/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -30,10 +30,14 @@
 if [ "${TESTJAVA}" = "" ] ; then
   TESTJAVA=/usr
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 
-# create a test keystore and dummy cert
+# create a test keystore and dummy cert. Note that we use the COMPILEJAVA
+# as this test is a TimeZone test, it doesn't test keytool
 rm -f ${TESTCLASSES}/timezonedatetest.store
-${TESTJAVA}/bin/keytool -genkeypair -alias testcert \
+${COMPILEJAVA}/bin/keytool ${TESTTOOLVMOPTS} -genkeypair -alias testcert \
   -keystore ${TESTCLASSES}/timezonedatetest.store \
   -storepass testpass -validity 360 \
   -dname "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL" \
@@ -41,12 +45,12 @@
 
 # create a jar file to sign with the test class in it.
 rm -f ${TESTCLASSES}/timezonedatetest.jar
-${TESTJAVA}/bin/jar cf \
+${COMPILEJAVA}/bin/jar ${TESTTOOLVMOPTS} cf \
   ${TESTCLASSES}/timezonedatetest.jar \
   -C ${TESTCLASSES} TimeZoneDatePermissionCheck.class
 
 # sign it
-${TESTJAVA}/bin/jarsigner \
+${COMPILEJAVA}/bin/jarsigner ${TESTTOOLVMOPTS} \
   -keystore ${TESTCLASSES}/timezonedatetest.store \
   -storepass testpass ${TESTCLASSES}/timezonedatetest.jar testcert
 
--- a/jdk/test/java/util/prefs/PrefsSpi.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/java/util/prefs/PrefsSpi.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -39,10 +39,13 @@
     TESTSRC="`pwd`"
     TESTCLASSES="`pwd`"
 fi
+if [ -z "$COMPILEJAVA" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
 
  java="$TESTJAVA/bin/java"
-javac="$TESTJAVA/bin/javac"
-  jar="$TESTJAVA/bin/jar"
+javac="$COMPILEJAVA/bin/javac"
+  jar="$COMPILEJAVA/bin/jar"
 
 Die() { printf "%s\n" "$*"; exit 1; }
 
@@ -81,9 +84,9 @@
 Sys mkdir -p jarDir/META-INF/services extDir
 echo "StubPreferencesFactory" \
   > "jarDir/META-INF/services/java.util.prefs.PreferencesFactory"
-Sys "$javac" -d jarDir StubPreferencesFactory.java StubPreferences.java
+Sys "$javac" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d jarDir StubPreferencesFactory.java StubPreferences.java
 
-(cd jarDir && "$jar" "cf" "../extDir/PrefsSpi.jar" ".")
+(cd jarDir && "$jar" ${TESTTOOLVMOPTS} "cf" "../extDir/PrefsSpi.jar" ".")
 
 case "`uname`" in Windows*|CYGWIN* ) CPS=';';; *) CPS=':';; esac
 
--- a/jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -35,6 +35,11 @@
 fi
 echo "TESTJAVA=${TESTJAVA}"
 
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+echo "COMPILEJAVA=${COMPILEJAVA}"
+
 if [ "${TESTSRC}" = "" ]
 then
     TESTSRC="."
@@ -72,7 +77,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
     -d . \
     -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar" \
     ${TESTSRC}${FS}FailOverTest.java
--- a/jdk/test/javax/script/CommonSetup.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/javax/script/CommonSetup.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -63,6 +63,11 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]
+then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -76,6 +81,6 @@
 fi
 
 JAVA="${TESTJAVA}/bin/java"
-JAVAC="${TESTJAVA}/bin/javac"
-JAR="${TESTJAVA}/bin/jar"
+JAVAC="${COMPILEJAVA}/bin/javac"
+JAR="${COMPILEJAVA}/bin/jar"
 
--- a/jdk/test/javax/script/ProviderTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/javax/script/ProviderTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -38,7 +38,7 @@
 
 echo "Creating JAR file ..."
 
-$JAR -cf ${TESTCLASSES}/dummy.jar \
+$JAR ${TESTTOOLVMOPTS} -cf ${TESTCLASSES}/dummy.jar \
     -C ${TESTCLASSES} DummyScriptEngine.class \
     -C ${TESTCLASSES} DummyScriptEngineFactory.class \
     -C "${TESTSRC}" META-INF/services/javax.script.ScriptEngineFactory
--- a/jdk/test/javax/security/auth/Subject/doAs/Test.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/javax/security/auth/Subject/doAs/Test.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -66,7 +66,8 @@
 # remove any leftover built class
 cd ${TESTCLASSES}${FS}
 ${RM} Test.class
-${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS} ${TESTSRC}${FS}Test.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS} \
+    ${TESTSRC}${FS}Test.java
 WD=`pwd`
 cd ${TESTSRC}${FS}
 cd $WD
--- a/jdk/test/lib/security/java.policy/Ext_AllPolicy.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/lib/security/java.policy/Ext_AllPolicy.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -46,6 +46,9 @@
   echo "FAILED!!!"
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 
 # set platform-dependent variables
 OS=`uname -s`
@@ -74,7 +77,7 @@
 # the test code
 
 cd ${TESTCLASSES}
-${TESTJAVA}${FS}bin${FS}jar -cvf Ext_AllPolicy.jar Ext_AllPolicy.class
+${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} -cvf Ext_AllPolicy.jar Ext_AllPolicy.class
 
 rm Ext_AllPolicy.class
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
--- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -90,7 +90,7 @@
 
 # Compile test 
 
-${TESTJAVA}/bin/javac -d ${TESTCLASSES} ${TESTCLASSES}/Null.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES} ${TESTCLASSES}/Null.java
 
 
 JAVA=${TESTJAVA}/bin/java
--- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -88,7 +88,7 @@
 
 # Compile test
 
-${TESTJAVA}/bin/javac -d ${TESTCLASSES} ${TESTCLASSES}/Dummy.java
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES} ${TESTCLASSES}/Dummy.java
 
 JAVA=${TESTJAVA}/bin/java
 CLASSPATH=${TESTCLASSES}
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -51,7 +51,8 @@
     rm -f ${_testclasses}/JMXStartStopTest.class
 
     # Compile testcase
-    ${TESTJAVA}/bin/javac -d ${_testclasses} JMXStartStopDoSomething.java JMXStartStopTest.java 
+    ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${_testclasses} \
+	JMXStartStopDoSomething.java JMXStartStopTest.java 
 
     if [ ! -f ${_testclasses}/JMXStartStopTest.class ]
     then
@@ -82,7 +83,7 @@
 }
 
 _get_pid(){
-    ${TESTJAVA}/bin/jps | sed -n "/JMXStartStopDoSomething/s/ .*//p"
+    ${COMPILEJAVA}/bin/jps ${TESTTOOLVMOPTS} | sed -n "/JMXStartStopDoSomething/s/ .*//p"
 }
 
 _app_stop(){
@@ -115,7 +116,7 @@
 
   
 _jcmd(){
-  ${TESTJAVA}/bin/jcmd JMXStartStopDoSomething $* > /dev/null 2>/dev/null
+  ${TESTJAVA}/bin/jcmd ${TESTTOOLVMOPTS} JMXStartStopDoSomething $* > /dev/null 2>/dev/null
 } 
 
 _echo(){
@@ -445,7 +446,7 @@
 
     _jcmd ManagementAgent.stop
 
-    pid=`${TESTJAVA}/bin/jps | sed -n "/JMXStartStopDoSomething/s/ .*//p"`
+    pid=`${COMPILEJAVA}/bin/jps ${TESTTOOLVMOPTS} | sed -n "/JMXStartStopDoSomething/s/ .*//p"`
     res2=`_testme local ${pid}`
 
     if [ "${res1}" = "OK_CONN" -a "${res2}" = "OK_CONN" ] 
@@ -528,6 +529,7 @@
 then
   echo "${TESTJAVA}/bin/jcmd"
   echo "Doesn't exist or not an executable"
+  exit
 fi
 
 
--- a/jdk/test/sun/net/www/MarkResetTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/net/www/MarkResetTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -46,7 +46,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}MarkResetTest.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}MarkResetTest.java
 
 # ftp server used by the test requires the file to be present
 # in this directory
--- a/jdk/test/sun/net/www/http/HttpClient/RetryPost.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/net/www/http/HttpClient/RetryPost.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -47,7 +47,7 @@
 esac
 
 # compile
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}RetryPost.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}RetryPost.java
 
 # run with no option specified. Should retry POST request.
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RetryPost
--- a/jdk/test/sun/net/www/protocol/jar/B5105410.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/net/www/protocol/jar/B5105410.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -50,6 +50,6 @@
 esac
 
 cp ${TESTSRC}${FS}foo2.jar .
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5105410.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}B5105410.java
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5105410
 
--- a/jdk/test/sun/net/www/protocol/jar/jarbug/run.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/net/www/protocol/jar/jarbug/run.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -59,17 +59,17 @@
 mkdir -p ${DEST}${FS}jar1
 cd ${TESTSRC}${FS}etc${FS}jar1
 cp -r . ${DEST}${FS}jar1
-${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${DEST}${FS}jar1 \
     ${TESTSRC}${FS}src${FS}jar1${FS}LoadResourceBundle.java
-${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${DEST}${FS}jar1 \
     ${TESTSRC}${FS}src${FS}jar1${FS}GetResource.java
 cd ${DEST}${FS}jar1
-${TESTJAVA}${FS}bin${FS}jar cfM jar1.jar jar1 res1.txt
+${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} cfM jar1.jar jar1 res1.txt
 mv jar1.jar ..
 #
 # build the test sources and run them
 #
-${TESTJAVA}${FS}bin${FS}javac -d ${DEST} ${TESTSRC}${FS}src${FS}test${FS}*.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${DEST} ${TESTSRC}${FS}src${FS}test${FS}*.java
 cd ${DEST}
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RunAllTests
 result=$?
--- a/jdk/test/sun/security/krb5/config/dns.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/krb5/config/dns.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -26,16 +26,19 @@
 # @summary Krb5LoginModule config class does not return proper KDC list from DNS
 #
 
+env
+
 if [ "${TESTJAVA}" = "" ] ; then
   JAVAC_CMD=`which javac`
   TESTJAVA=`dirname $JAVAC_CMD`/..
+  COMPILEJAVA="${TESTJAVA}"
 fi
 
 if [ "${TESTSRC}" = "" ] ; then
    TESTSRC="."
 fi
 
-$TESTJAVA/bin/javac -d . \
-        ${TESTSRC}/NamingManager.java ${TESTSRC}/DNS.java
+$COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+   ${TESTSRC}/NamingManager.java ${TESTSRC}/DNS.java
 $TESTJAVA/bin/java -Xbootclasspath/p:. DNS
 
--- a/jdk/test/sun/security/krb5/runNameEquals.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/krb5/runNameEquals.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,6 +43,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 NATIVE=false
 
 # set platform-dependent variables
@@ -73,7 +77,7 @@
 
 TEST=Krb5NameEquals
 
-${TESTJAVA}${FILESEP}bin${FILESEP}javac \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
     -d ${TESTCLASSES}${FILESEP} \
     ${TESTSRC}${FILESEP}${TEST}.java
 
--- a/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -39,7 +39,7 @@
     #
     #  execute test program - rely on it to exit if platform unsupported
 
-	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\IsSunMSCAPIAvailable.java
+	${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}\\IsSunMSCAPIAvailable.java
 	${TESTJAVA}/bin/java ${TESTVMOPTS} IsSunMSCAPIAvailable
 	exit
 	;;
--- a/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -54,9 +54,13 @@
 if [ "${TESTJAVA}" = "" ] ; then
     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo echo COMPILEJAVA=${COMPILEJAVA}
 echo ""
 
 # get command from input args -
@@ -163,7 +167,7 @@
 # compile test
 
 if [ "${RECOMPILE}" = "yes" ] ; then
-    ${TESTJAVA}${FS}bin${FS}javac \
+    ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 	-d ${TESTCLASSES} \
 	${TESTSRC}${FS}Basic.java
--- a/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -40,9 +40,13 @@
 if [ "${TESTJAVA}" = "" ] ; then
     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo COMPILEJAVA=${COMPILEJAVA}
 echo ""
 
 OS=`uname -s`
@@ -121,7 +125,7 @@
 ${CHMOD} +w ${TESTCLASSES}${FS}key3.db
 
 # compile test
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 	-d ${TESTCLASSES} \
 	${TESTSRC}${FS}ClientAuth.java
--- a/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -53,9 +53,13 @@
 if [ "${TESTJAVA}" = "" ] ; then
     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo COMPILEJAVA=${COMPILEJAVA}
 echo ""
 
 # get command from input args -
@@ -133,7 +137,7 @@
 if [ "${RECOMPILE}" = "yes" ] ; then
     cd ${TESTCLASSES}
     ${RM} *.class
-    ${TESTJAVA}${FS}bin${FS}javac \
+    ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
 	-classpath ${TESTSRC}${FS}..${PS}${TESTSRC}${FS}loader.jar \
 	-d ${TESTCLASSES} \
 	${TESTSRC}${FS}Basic.java
--- a/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -41,9 +41,13 @@
 if [ "${TESTJAVA}" = "" ] ; then
     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo COMPILEJAVA=${COMPILEJAVA}
 echo ""
 
 # let java test exit if platform unsupported
@@ -92,7 +96,7 @@
 
 # compile test
 
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FS}.. \
         -d ${TESTCLASSES} \
         ${TESTSRC}${FS}ConfigQuotedString.java
--- a/jdk/test/sun/security/pkcs11/Provider/Login.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/pkcs11/Provider/Login.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -42,9 +42,13 @@
 if [ "${TESTJAVA}" = "" ] ; then
     TESTJAVA="/net/radiant/export1/charlie/mustang/build/solaris-sparc"
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
 echo TESTSRC=${TESTSRC}
 echo TESTCLASSES=${TESTCLASSES}
 echo TESTJAVA=${TESTJAVA}
+echo COMPILEJAVA=${COMPILEJAVA}
 echo ""
 
 # let java test exit if platform unsupported
@@ -101,7 +105,7 @@
 
 # compile test
 
-${TESTJAVA}${FS}bin${FS}javac \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
         -classpath ${TESTSRC}${FS}.. \
         -d ${TESTCLASSES} \
         ${TESTSRC}${FS}Login.java
--- a/jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -41,6 +41,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+   COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -65,12 +69,14 @@
 # compile the test program
 cd ${TESTSRC}${FILESEP}
 rm GrantAllPermToExtWhenNoPolicy.class
-${TESTJAVA}${FILESEP}bin${FILESEP}javac -d ${TESTSRC}${FILESEP} ${TESTSRC}${FILESEP}SomeExtensionClass.java
-${TESTJAVA}${FILESEP}bin${FILESEP}javac -d ${TESTSRC}${FILESEP} ${TESTSRC}${FILESEP}GrantAllPermToExtWhenNoPolicy.java
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
+    -d ${TESTSRC}${FILESEP} ${TESTSRC}${FILESEP}SomeExtensionClass.java
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
+    -d ${TESTSRC}${FILESEP} ${TESTSRC}${FILESEP}GrantAllPermToExtWhenNoPolicy.java
 
 # create the extension JAR file
 cd ${TESTCLASSES}
-${TESTJAVA}${FILESEP}bin${FILESEP}jar cvf SomeExt.jar SomeExtensionClass*.class
+${COMPILEJAVA}${FILESEP}bin${FILESEP}jar cvf SomeExt.jar SomeExtensionClass*.class
 rm SomeExtensionClass.class
 
 # move the extension JAR file to the extension directory
--- a/jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -44,6 +44,10 @@
    exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+    COMPILEJAVA="${TESTJAVA}"
+fi
+
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
@@ -81,15 +85,15 @@
 fi
 
 cd ${TESTSRC}${FS}
-${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}boot \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS}boot \
         ${TESTSRC}${FS}NoArgPermission.java
-${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}boot \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS}boot \
         ${TESTSRC}${FS}OneArgPermission.java
-${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}boot \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS}boot \
         ${TESTSRC}${FS}TwoArgPermission.java
-${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}boot \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS}boot \
         ${TESTSRC}${FS}TwoArgNullActionsPermission.java
-${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}app \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}${FS}app \
         ${TESTSRC}${FS}GetInstance.java
 
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS}  \
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -51,7 +51,8 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}DebugReportsOneExtraByte.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}${FS}DebugReportsOneExtraByte.java
 
 STRING='main, WRITE: TLSv1 Application Data, length = 8'
 
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -35,6 +35,10 @@
         exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+        COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
         TESTSRC="."
@@ -63,12 +67,12 @@
 #
 # Compile the tests, package into their respective jars
 #
-${TESTJAVA}${FILESEP}bin${FILESEP}javac -d . \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
     ${TESTSRC}${FILESEP}NotifyHandshakeTest.java \
     ${TESTSRC}${FILESEP}NotifyHandshakeTestHeyYou.java
-${TESTJAVA}${FILESEP}bin${FILESEP}jar -cvf com.jar \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}jar ${TESTTOOLVMOPTS} -cvf com.jar \
     com${FILESEP}NotifyHandshakeTest*.class
-${TESTJAVA}${FILESEP}bin${FILESEP}jar -cvf edu.jar \
+${COMPILEJAVA}${FILESEP}bin${FILESEP}jar ${TESTTOOLVMOPTS} -cvf edu.jar \
     edu${FILESEP}NotifyHandshakeTestHeyYou.class
 
 #
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -50,7 +50,9 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}OriginServer.java \
-    ${TESTSRC}${FS}ProxyTunnelServer.java ${TESTSRC}${FS}PostThruProxy.java
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \
+    ${TESTSRC}${FS}OriginServer.java \
+    ${TESTSRC}${FS}ProxyTunnelServer.java \
+    ${TESTSRC}${FS}PostThruProxy.java
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} PostThruProxy ${HOSTNAME} ${TESTSRC}
 exit
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -50,7 +50,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}OriginServer.java \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}OriginServer.java \
     ${TESTSRC}${FS}ProxyTunnelServer.java \
     ${TESTSRC}${FS}PostThruProxyWithAuth.java
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} PostThruProxyWithAuth ${HOSTNAME} ${TESTSRC}
--- a/jdk/test/sun/security/tools/keytool/autotest.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/tools/keytool/autotest.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -40,6 +40,9 @@
   echo "FAILED!!!"
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 
 find_one() {
   for TARGET_FILE in $@; do
@@ -82,7 +85,7 @@
   exit 1
 fi
 
-${TESTJAVA}${FS}bin${FS}javac -d . -XDignore.symbol.file \
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . -XDignore.symbol.file \
         ${TESTSRC}${FS}KeyToolTest.java || exit 10
 
 NSS=${TESTSRC}${FS}..${FS}..${FS}pkcs11${FS}nss
--- a/jdk/test/sun/security/tools/keytool/printssl.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/tools/keytool/printssl.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -33,6 +33,9 @@
   echo "FAILED!!!"
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 
 # set platform-dependent variables
 OS=`uname -s`
@@ -52,7 +55,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}PrintSSL.java || exit 10
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}PrintSSL.java || exit 10
 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=$TESTSRC PrintSSL | ( read PORT; ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT )
 status=$?
 
--- a/jdk/test/sun/security/tools/keytool/readjar.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/tools/keytool/readjar.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -29,6 +29,7 @@
 if [ "${TESTJAVA}" = "" ] ; then
   JAVAC_CMD=`which javac`
   TESTJAVA=`dirname $JAVAC_CMD`/..
+  COMPILEJAVA=${TESTJAVA}
 fi
 
 # set platform-dependent variables
@@ -44,13 +45,13 @@
 
 KS=readjar.jks
 rm $KS
-$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS \
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS}  -storepass changeit -keypass changeit -keystore $KS \
         -alias x -dname CN=X -genkeypair
-$TESTJAVA${FS}bin${FS}jar cvf readjar.jar $KS
-$TESTJAVA${FS}bin${FS}jarsigner -storepass changeit -keystore $KS readjar.jar x
+$COMPILEJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf readjar.jar $KS
+$COMPILEJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -storepass changeit -keystore $KS readjar.jar x
 
-$TESTJAVA${FS}bin${FS}keytool -printcert -jarfile readjar.jar || exit 1
-$TESTJAVA${FS}bin${FS}keytool -printcert -jarfile readjar.jar -rfc || exit 1
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -jarfile readjar.jar || exit 1
+$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -jarfile readjar.jar -rfc || exit 1
 
 exit 0
 
--- a/jdk/test/sun/security/tools/keytool/standard.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/tools/keytool/standard.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -39,6 +39,7 @@
 if [ "${TESTJAVA}" = "" ] ; then
   JAVAC_CMD=`which javac`
   TESTJAVA=`dirname $JAVAC_CMD`/..
+  COMPILEJAVA="${TESTJAVA}"
 fi
 
 # set platform-dependent variables
@@ -56,7 +57,7 @@
     ;;
 esac
 
-${TESTJAVA}${FS}bin${FS}javac -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
+${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
 
 echo | ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dfile KeyToolTest
 status=$?
--- a/jdk/test/sun/security/util/Oid/S11N.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/util/Oid/S11N.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -39,6 +39,9 @@
   echo "FAILED!!!"
   exit 1
 fi
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
 
 # set platform-dependent variables
 PF=""
@@ -103,7 +106,7 @@
 
 # the test code
 
-${TESTJAVA}${FS}bin${FS}javac -target 1.4 -source 1.4 \
+${COMPILEJAVA}${FS}bin${FS}javac -target 1.4 -source 1.4 \
         -d . ${TESTSRC}${FS}SerialTest.java || exit 10
 
 # You can set ALT_JAVA_RE_JDK to another location that contains the
--- a/jdk/test/sun/security/validator/certreplace.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/validator/certreplace.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -33,6 +33,7 @@
 if [ "${TESTJAVA}" = "" ] ; then
   JAVAC_CMD=`which javac`
   TESTJAVA=`dirname $JAVAC_CMD`/..
+  COMPILEJAVA="${TESTJAVA}"
 fi
 
 # set platform-dependent variables
@@ -48,7 +49,7 @@
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
     -keypass changeit -keystore certreplace.jks"
-JAVAC=$TESTJAVA${FS}bin${FS}javac
+JAVAC=$COMPILEJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java
 
 rm -rf certreplace.jks 2> /dev/null
@@ -81,5 +82,5 @@
 
 # 5. Build and run test
 
-$JAVAC -d . ${TESTSRC}${FS}CertReplace.java
+$JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}CertReplace.java
 $JAVA ${TESTVMOPTS} CertReplace certreplace.jks certreplace.certs
--- a/jdk/test/sun/security/validator/samedn.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/sun/security/validator/samedn.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -33,6 +33,7 @@
 if [ "${TESTJAVA}" = "" ] ; then
   JAVAC_CMD=`which javac`
   TESTJAVA=`dirname $JAVAC_CMD`/..
+  COMPILEJAVA="${TESTJAVA}"
 fi
 
 # set platform-dependent variables
@@ -48,7 +49,7 @@
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
     -keypass changeit -keystore samedn.jks"
-JAVAC=$TESTJAVA${FS}bin${FS}javac
+JAVAC=$COMPILEJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java
 
 rm -rf samedn.jks 2> /dev/null
@@ -77,6 +78,6 @@
 # 5. Build and run test. Make sure the CA certs are ignored for validity check.
 # Check both, one of them might be dropped out of map in old codes.
 
-$JAVAC -d . ${TESTSRC}${FS}CertReplace.java
+$JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}CertReplace.java
 $JAVA ${TESTVMOPTS} CertReplace samedn.jks samedn1.certs || exit 1
 $JAVA ${TESTVMOPTS} CertReplace samedn.jks samedn2.certs || exit 2
--- a/jdk/test/tools/launcher/ClassPathWildCard.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/tools/launcher/ClassPathWildCard.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -43,6 +43,10 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]; then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
   exit 1
@@ -54,8 +58,8 @@
 fi
 
 JAVA=$TESTJAVA/bin/java
-JAVAC=$TESTJAVA/bin/javac
-JAR=$TESTJAVA/bin/jar
+JAVAC=$COMPILEJAVA/bin/javac
+JAR=$COMPILEJAVA/bin/jar
 
 OUTEXT=".out"
 
@@ -91,14 +95,14 @@
   Exp=$1
   [ -d Test${Exp} ] || mkdir Test${Exp} 
   EmitJavaFile Test${Exp}/Test${Exp}.java
-  $JAVAC  -d Test${Exp} Test${Exp}/Test${Exp}.java || exit 1
+  $JAVAC ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d Test${Exp} Test${Exp}/Test${Exp}.java || exit 1
 }
 
 CreateJarFiles() {
   Exp=$1
   [ -d JarDir ] || mkdir JarDir
   CreateClassFiles $Exp
-  $JAR -cvf JarDir/Test${Exp}.jar -C Test${Exp} . || exit 1
+  $JAR ${TESTTOOLVMOPTS} -cvf JarDir/Test${Exp}.jar -C Test${Exp} . || exit 1
 }
 
 CheckFail() {
--- a/jdk/test/tools/launcher/MultipleJRE.sh	Fri Jan 11 12:27:57 2013 +0000
+++ b/jdk/test/tools/launcher/MultipleJRE.sh	Fri Jan 11 20:19:55 2013 +0000
@@ -37,6 +37,10 @@
   exit 1
 fi
 
+if [ "${COMPILEJAVA}" = "" ]; then
+  COMPILEJAVA="${TESTJAVA}"
+fi
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -51,7 +55,7 @@
 
 JAVAEXE="$TESTJAVA/bin/java ${TESTVMOPTS}"
 JAVA="$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES"
-JAR="$TESTJAVA/bin/jar"
+JAR="$COMPILEJAVA/bin/jar ${TESTTOOLVMOPTS}"
 OS=`uname -s`;
 
 #