8173947: jconsole does not show local running VMs to attach
Reviewed-by: alanb, dholmes, dfuchs
--- 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;
}