From 72c87d9cdf6da0dbc8de6a17026eb5c23375fdea Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 29 Jul 2024 19:04:49 +0100 Subject: [PATCH] JAL-3631 Add PID to console info - only available in Java 9+ --- src/jalview/bin/Cache.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index f79c265..681394f 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -68,6 +68,7 @@ import jalview.urls.IdOrgSettings; import jalview.util.ChannelProperties; import jalview.util.ColorUtils; import jalview.util.HttpUtils; +import jalview.util.LaunchUtils; import jalview.util.MessageManager; import jalview.util.Platform; import jalview.ws.sifts.SiftsSettings; @@ -1273,6 +1274,14 @@ public class Cache sb.append(" ("); sb.append(lafClass); sb.append(")\n"); + // pid() only available in Java 9+ + if (LaunchUtils.getJavaVersion() > 8) + { + sb.append("Java Virtual Machine PID: "); + sb.append(ProcessHandle.current().pid()); + sb.append("\n"); + } + } appendIfNotNull(sb, "Installer version: ", System.getProperty("sys.install4jVersion"), "\n", null); -- 1.7.10.2