Proposal: Option to ignore non-existent -javaagent

Alan Bateman Alan.Bateman at oracle.com
Mon Jul 8 09:18:34 UTC 2024


On 03/07/2024 11:26, Thiago Henrique Hupner wrote:
> Dear JDK developers,
>
> I'd like to propose adding an option that allows the JVM to ignore a 
> non-existent -javaagent instead of aborting.
>
> Currently, if a -javaagent is specified but the agent jar file doesn't 
> exist, the JVM aborts with an error. This can cause issues in 
> environments where the same JVM arguments are used across different 
> systems, but not all systems have the agent installed.

In general you can't assume that the same VM options or arguments to the 
java launcher can be used across different systems, different JDK 
releases, or in this case specifying a tool agent that may not be 
installed or may be installed in a different location. For this case it 
may be better to re-visit the launch script for the application so that 
it conditionally adds the -javaagent option when the tool agent is needed.

-Alan


More information about the serviceability-dev mailing list