Check for a behavior change in Java agents

Java agent premain and agentmain methods must be public in Java SE 17. This was always required by the specification, but was not previously enforced. In addition, premain and agentmain methods must be defined in the agent class, they cannot be defined in a superclass.

This rule has an automated fix. Copy the custom configuration to your application build file to enable the fix automation.

The automated fix sets the visibility of premain and agentmain methods to public.

For more information on these changes, see Requirements of an Agent's premain Method Changed to Conform to the Specification.