Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit 0ec12a2

Browse files
authored
Merge pull request #71 from martijnhoekstra/issue-70
manually check for a .exe
2 parents b8ded66 + 70f82d8 commit 0ec12a2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/scala/scala/tools/partest/PartestDefaults.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ object PartestDefaults {
2222

2323
// probe for the named executable
2424
private def jdkexec(name: String): Option[String] = {
25-
import scala.reflect.io.Path, Path._
26-
Some(Path(jdkHome) / "bin") filter (_.isDirectory) flatMap { p =>
27-
val candidates = (p walkFilter { e => (e.name == name || e.name.startsWith(s"$name.")) && e.jfile.canExecute }).toList
28-
(candidates find (_.name == name) orElse candidates.headOption) map (_.path)
29-
}
25+
import scala.reflect.io.Path, Path._, scala.tools.nsc.Properties.isWin
26+
(Path(jdkHome) / "bin").walk.find(e => e.name == name || isWin && e.name.equalsIgnoreCase(s"$name.exe")).map(_.path)
3027
}
3128
}

0 commit comments

Comments
 (0)