Skip to content

Commit

Permalink
Add correct binary name to native agent task (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored May 9, 2024
1 parent c822374 commit ec726cb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ec726cb

Please sign in to comment.