changeset 16642:d571f86c2762

8173947: jconsole does not show local running VMs to attach Reviewed-by: alanb, dholmes, dfuchs
author mchung
date Mon, 06 Feb 2017 08:03:33 -0800
parents 93005a285d67
children 3ec66890e682
files src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
diffstat 1 files changed, 5 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java	Mon Feb 06 08:59:00 2017 -0500
+++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java	Mon Feb 06 08:03:33 2017 -0800
@@ -949,23 +949,12 @@
         }
     }
 
-    private static final boolean localAttachmentSupported;
-    static {
-        boolean supported;
-        try {
-            Class.forName("com.sun.tools.attach.VirtualMachine");
-            Class.forName("sun.management.ConnectorAddressLink");
-            supported = true;
-        } catch (NoClassDefFoundError x) {
-            supported = false;
-        } catch (ClassNotFoundException x) {
-            supported = false;
-        }
-        localAttachmentSupported = supported;
-    }
-
+    /**
+     * local attach is supported in this implementation as jdk.jconsole
+     * requires jdk.attach and jdk.management.agent
+     */
     public static boolean isLocalAttachAvailable() {
-        return localAttachmentSupported;
+        return true;
     }