From: Ben Soares Date: Mon, 29 Jul 2024 18:04:49 +0000 (+0100) Subject: JAL-3631 Add PID to console info - only available in Java 9+ X-Git-Tag: Release_2_11_4_0~17^2~3^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=72c87d9cdf6da0dbc8de6a17026eb5c23375fdea;p=jalview.git JAL-3631 Add PID to console info - only available in Java 9+ --- 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);