Skip to content

Commit

Permalink
respect java home
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7d8 committed Apr 26, 2024
1 parent 796277c commit 2accda3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ public static void main(final String[] args) {

String[] vmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments().toArray(new String[0]);
String[] cmd = new String[vmArgs.length + 2];
cmd[0] = "java";

String javaHome = System.getenv("JAVA_HOME");
if (javaHome == null) {
cmd[0] = "java";
} else {
cmd[0] = javaHome + "/bin/java";
}

System.arraycopy(vmArgs, 0, cmd, 1, vmArgs.length);

Expand Down

0 comments on commit 2accda3

Please sign in to comment.