Disallowing the dynamic loading of agents by default (revised)

Michael Rasmussen michael.rasmussen at zeroturnaround.com
Wed Apr 5 17:00:13 UTC 2017


On 5 April 2017 at 19:15,  <mark.reinhold at oracle.com> wrote:
>   - Enhance the `-jar` launcher option so that if the JAR file being
>     launched contains a `Premain-Class` attribute then it's launched
>     as both an application and as an agent for that application.
>
>     This will allow `java -jar foo.jar` to be used in place of the
>     more verbose `java -javaagent:foo.jar -jar foo.jar` [1].

I would propose the presence of an addition option in the manifest to
enable/control this behavior.

In the case of standalone agents, running them as -jar are sometimes
used for a different purpose than running them as agents.
For instance, in the case of JRebel, java -jar jrebel.jar is used for
license activation/control, and should not activate the agent part.

Kind regards
Michael Rasmussen
JRebel, Product Manager
ZeroTurnaround


More information about the jigsaw-dev mailing list