8173947: jconsole does not show local running VMs to attach
authormchung
Mon, 06 Feb 2017 08:03:33 -0800
changeset 43542 f86360855fee
parent 43541 9aeb1de77a63
child 43543 36f684103d94
8173947: jconsole does not show local running VMs to attach Reviewed-by: alanb, dholmes, dfuchs
jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
--- a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java	Mon Feb 06 08:59:00 2017 -0500
+++ b/jdk/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;
     }