Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160950

Agent JAR added to app class loader rather than system class loader when running with -Djava.system.class.loader

    Details

      Description

      When running with `-javaagent:myagent.jar -Djava.system.classloader=MyClassLoader` then the myagent.jar is added to the application class loader rather than the custom system class loader.

      This issue tracks changing the implementation so that appendClassPath is not used in Agent_OnLoad, instead it is call just before the agent class is loaded, probably invokeJavaAgentMainMethod.

      In addition, package description will likely need a small update to make it clear that a custom system class loader will need to define appendToClassPathForInstrumentation in order to load the agent. Currently custom system class loaders are not required to implement this method.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sspitsyn Serguei Spitsyn
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: