Classpath for Java Agents is not automatically added to the application classpath

Description

A problem with executing Java Agents was reported on the researchers mailing lists in the thread "using a java agent ":

I have problems with the classloader using a java agent. On a single
class, everything works fine, but on a jar, I get the following exception:

Failed to run the agent's premain: fullpath.Agent not found in SystemAppCL
java.lang.ClassNotFoundException: fullpath.Agent not found in SystemAppCL
at java.net.URLClassLoader.findClass(URLClassLoader.java:531)
at java.lang.ClassLoader.loadClass(ClassLoader.java:341)
at java.lang.ClassLoader.loadClass(ClassLoader.java:293)

after executing:

./dist/prototype-opt_x86_64-linux/rvm -javaagent:agent.jar=frames2000
-jar dacapo-2006-10.jar lusearch

in the terminal (same exception with every other .jar file).

I've taken a look at this and it seems that there aren't any separate repositories for Java agents. When the arguments are processed, the classpath of the agent is discarded when the -javaagent option is passed before the -jar option.

Environment

All

Status

Assignee

Erik Brangs

Reporter

Erik Brangs

Labels

None

Components

Fix versions

Affects versions

Priority

Medium
Configure