< prev index next >
jdk/test/lib/testlibrary/jdk/testlibrary/JDKToolFinder.java
Print this page
rev 17427 : imported patch 8182154
*** 97,111 ****
throw new RuntimeException(
"System property '" + property + "' not set. This property is normally set by jtreg. "
+ "When running test separately, set this property using '-D" + property + "=/path/to/jdk'.");
}
! Path toolName = Paths.get("bin", tool + (Platform.isWindows() ? ".exe" : ""));
Path jdkTool = Paths.get(jdkPath, toolName.toString());
if (!jdkTool.toFile().exists()) {
throw new FileNotFoundException("Could not find file " + jdkTool.toAbsolutePath());
}
return jdkTool.toAbsolutePath().toString();
}
}
--- 97,115 ----
throw new RuntimeException(
"System property '" + property + "' not set. This property is normally set by jtreg. "
+ "When running test separately, set this property using '-D" + property + "=/path/to/jdk'.");
}
! Path toolName = Paths.get("bin", tool + (isWindows() ? ".exe" : ""));
Path jdkTool = Paths.get(jdkPath, toolName.toString());
if (!jdkTool.toFile().exists()) {
throw new FileNotFoundException("Could not find file " + jdkTool.toAbsolutePath());
}
return jdkTool.toAbsolutePath().toString();
}
+
+ private static boolean isWindows() {
+ return System.getProperty("os.name").toLowerCase().startsWith("win");
+ }
}
< prev index next >