From 03e2eb794f902d2f74c32c96f193ae73f373c597 Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Wed, 8 May 2024 18:53:23 +0200 Subject: [PATCH] Add correct binary name to native agent task --- .../java/com/gluonhq/gradle/tasks/NativeRunAgentTask.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gluonhq/gradle/tasks/NativeRunAgentTask.java b/src/main/java/com/gluonhq/gradle/tasks/NativeRunAgentTask.java index da31dcc..b9ec867 100644 --- a/src/main/java/com/gluonhq/gradle/tasks/NativeRunAgentTask.java +++ b/src/main/java/com/gluonhq/gradle/tasks/NativeRunAgentTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Gluon + * Copyright (c) 2021, 2024, Gluon * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Locale; public class NativeRunAgentTask extends NativeBaseTask { @@ -105,7 +106,8 @@ public void action() { } // set java_home - execTask.executable(Path.of(graalVMHome.toString(), "bin", "java").toString()); + String binary = System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows") ? "java.exe" : "java"; + execTask.executable(Path.of(graalVMHome.toString(), "bin", binary).toString()); // set jvmargs var jvmArgs = List.of(AGENTLIB_NATIVE_IMAGE_AGENT_STRING);