--- old/test/script/nosecurity/jjs-common.js 2016-03-18 17:08:35.882165052 +0530 +++ new/test/script/nosecurity/jjs-common.js 2016-03-18 17:08:35.702165052 +0530 @@ -26,15 +26,29 @@ * @subtest * @summary test used by all other jjs-option* test cases */ -var javaHome = $ENV.JAVA_HOME, - homeJjs = "${javaHome}/bin/jjs", - altJjs = $EXEC('which jjs').trim(), - homejavac = "${javaHome}/bin/javac", - altjavac = $EXEC('which javac').trim() - -var Files = Java.type('java.nio.file.Files'), - Paths = Java.type('java.nio.file.Paths'), - System = Java.type('java.lang.System') + +load(__DIR__ + "JDK-util.js") + +var javaHome = System.getenv("JAVA_HOME"), + homeJjs = "${javaHome}" + "/bin/jjs", + altJjs = which('jjs'), + homejavac = "${javaHome}" + "/bin/javac", + altjavac = which('javac') + +if (windows) { + if (winCyg) { + //Files.exists() expects proper extension as it talks to windows filesystem even on cygwin + //make paths work on on underlying shells cygwin/cmd/linux. + homeJjs = toShellPath("${javaHome}" + "/bin/jjs.exe") + homejavac = toShellPath("${javaHome}" + "/bin/javac.exe") + } + else { + homeJjs = toShellPath("${javaHome}" + "\\bin\\jjs.exe") + homejavac = toShellPath("${javaHome}" + "\\bin\\javac.exe") + } + altJjs = which('jjs.exe') + altjavac = which('javac.exe') +} // Initialize default values for variables used in different functions var func_cond_p = <