Skip to content

Commit

Permalink
Merge pull request #41972 from gabilang/fix-profiler-warning
Browse files Browse the repository at this point in the history
Fix incompatible JRE version warning which is popped up while profiling a Ballerina program
  • Loading branch information
warunalakshitha authored Feb 12, 2024
2 parents 25c6b07 + a05b7b4 commit 3c69ba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class ProfilerMethodWrapper extends ClassLoader {
public void invokeMethods(String debugArg) throws IOException, InterruptedException {
String balJarArgs = Main.getBalJarArgs();
List<String> commands = new ArrayList<>();
commands.add("java");
commands.add(System.getenv("java.command"));
commands.add("-jar");
if (debugArg != null) {
commands.add(debugArg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private void initiateProfiler(Project project) {
pb.environment().put(JAVA_OPTS, getAgentArgs());
pb.environment().put(BALLERINA_HOME, System.getProperty(BALLERINA_HOME));
pb.environment().put(CURRENT_DIR_KEY, System.getProperty(USER_DIR));
pb.environment().put("java.command", System.getProperty("java.command"));
pb.directory(new File(getProfilerPath(project).toUri()));
Process process = pb.start();
process.waitFor();
Expand Down

0 comments on commit 3c69ba4

Please sign in to comment.