JDK-8043939 : Remove management-agent.jar
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-05-25
  • Updated: 2017-05-17
  • Resolved: 2014-06-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b20Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8179063 :  
Description
management-agent.jar is the java agent that is used with the attach API to start the JMX agent in a target VM. It's the approach used in JDK 6 to start JMX in a running VM and predates the "jcmd ManagementAgent.start" command added in 7uX.

management-agent.jar will be problematic when we move to a modular JDK in JDK 9. This bug requests that this legacy mechanism be re-examined, the compatibility risk is probably not too high although tools such as VisualVM should be checked as it may be using this mechanism.
Comments
See JDK-8044135 for the new API.
28-05-2014

My plan is to add support in the VirtualMachine class in the attach framework for launching JMX agents. Probably that is easier than launching jcmd. Here is what I'm thinking: /** * Starts the JMX management agent in the target virtual machine. * * <p> The configuration properties are the same as those specified on * the command line when starting the JMX management agent. In the same * way as on the command line, you need to specify at least the * {@code com.sun.management.jmxremote.port} property. * * <p> See the online documentation for "Monitoring and Management Using * JMX Technology" for further details. * * <p> This method replaces the previous method of loading the * {@code management-api.jar} agent to start the management agent. * * @param agentProperties * A Properties object containing the configuration properties * for the agent. * * @throws IOException * If an I/O error occurs * * @since 1.9 */ public abstract void startManagementAgent(Properties agentProperties) throws IOException; /** * Starts the local JMX management agent in the target virtual machine. * * <p> See the online documentation for "Monitoring and Management Using * JMX Technology" for further details. * * <p> This method replaces the previous method of loading the * {@code management-api.jar} agent to start the management agent. * * @throws IOException * If an I/O error occurs * * @since 1.9 */ public abstract void startLocalManagementAgent() throws IOException;
27-05-2014

I filed the bug for VisualVM <https://java.net/jira/browse/VISUALVM-592>. VisualVM should use jcmd to enable JMX agent in a target VM.
27-05-2014

You are right, VisualVM uses management-agent.jar to enable JMX agent in a target VM.
26-05-2014