[MNG-7578] Fallback on Linux executable in Windows for findTool utility (#861)

* [MVN-7578] Fallback on Linux executable in Windows for findTool utility
* Fix code style
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
This commit is contained in:
Simon 2022-12-09 10:07:48 +01:00 committed by GitHub
parent f27b975ddc
commit 55431cd267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -63,7 +63,14 @@ class JavaToolchainImpl extends DefaultToolchain implements JavaToolchain {
private static File findTool(String toolName, File installFolder) {
File bin = new File(installFolder, "bin"); // NOI18N
if (bin.exists()) {
File tool = new File(bin, toolName + (Os.isFamily("windows") ? ".exe" : "")); // NOI18N
boolean isWindows = Os.isFamily("windows"); // NOI18N
if (isWindows) {
File tool = new File(bin, toolName + ".exe");
if (tool.exists()) {
return tool;
}
}
File tool = new File(bin, toolName);
if (tool.exists()) {
return tool;
}