From 6980a8e4cc15296e1853868c13a6d04e2a5da1db Mon Sep 17 00:00:00 2001 From: Michael Haupt Date: Thu, 2 Jul 2015 11:09:20 +0200 Subject: [PATCH] 8130306: enable running Nashorn test on Windows Fix executable name (add .exe suffix) Reviewed-by: hannesw, sundar --- nashorn/test/script/nosecurity/JDK-8050964.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nashorn/test/script/nosecurity/JDK-8050964.js b/nashorn/test/script/nosecurity/JDK-8050964.js index 59329682b20..04a19f1808b 100644 --- a/nashorn/test/script/nosecurity/JDK-8050964.js +++ b/nashorn/test/script/nosecurity/JDK-8050964.js @@ -46,10 +46,14 @@ if (! nashornJar.isAbsolute()) { nashornJar = new File(".", nashornJar); } +var os = System.getProperty("os.name"), + win = os.startsWith("Windows"), + jdepsName = "jdeps" + (win ? ".exe" : ""); + var javahome = System.getProperty("java.home"); -var jdepsPath = javahome + "/../bin/jdeps".replace(/\//g, File.separator); +var jdepsPath = javahome + "/../bin/".replace(/\//g, File.separator) + jdepsName; if (! new File(jdepsPath).isFile()) { - jdepsPath = javahome + "/bin/jdeps".replace(/\//g, File.separator); + jdepsPath = javahome + "/bin/".replace(/\//g, File.separator) + jdepsName; } // run jdep on nashorn.jar - only summary but print profile info