From 156d32f04cecd1d80992185fb3c24bb143396775 Mon Sep 17 00:00:00 2001 From: Olafur Pall Geirsson Date: Tue, 8 Sep 2020 21:59:32 +0200 Subject: [PATCH] Use native-image.exe --- .../src/main/scala/sbtnativeimage/NativeImagePlugin.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala b/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala index 1d26783..3e1c441 100644 --- a/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala +++ b/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala @@ -113,10 +113,13 @@ object NativeImagePlugin extends AutoPlugin { "true".equalsIgnoreCase(System.getProperty("native-image-installed")) || "true".equalsIgnoreCase(System.getenv("NATIVE_IMAGE_INSTALLED")) ) { - val path = Paths + val binary = + if (Properties.isWin) "native-image.exe" else "native-image" + val bin = Paths .get(System.getenv("JAVA_HOME")) .resolve("bin") - .resolve("native-image") + println(s"FILES: ${bin.toFile().listFiles().toList}") + val path = bin.resolve(binary) Def.task(List[String](path.toString())) } else { Def.task {