[Java] Agent error on start

NewRelic Java Agent error on start

I’m using Java jdk-11.0.7, and the NewRelic JavaAgent 6.1.0

this is how the program is run, on windows (just for testing)
"C:\Program Files\Java\jdk-11.0.7\bin\java.exe" -javaagent:C:\Users\...\Desktop\newrelic\newrelic-6.1.0.jar -jar ...\target\...-0.0.1-SNAPSHOT.jar

When I start my program, I get this error and the program exits
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.newrelic.weave.weavepackage.NewClassAppender (file:/.../target/...-0.0.1-SNAPSHOT.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.newrelic.weave.weavepackage.NewClassAppender WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Unable to start New Relic Agent. Please remove -javaagent from your startup arguments and contact New Relic support. Applications that previously relied on the command line flag '--add-modules' will no longer work with Java EE dependencies. You must add all Java EE dependencies to your build file manually, and then remove the --add-modules flag for them. java.lang.NoClassDefFoundError: java/sql/SQLException at com.newrelic.agent.database.ParsedDatabaseStatement.<init>(ParsedDatabaseStatement.java:26) at com.newrelic.agent.database.SelectVariableStatementFactory.<init>(SelectVariableStatementFactory.java:19) at com.newrelic.agent.database.DefaultDatabaseStatementParser.<init>(DefaultDatabaseStatementParser.java:55) at com.newrelic.agent.database.DatabaseService.<init>(DatabaseService.java:40) at com.newrelic.agent.service.ServiceManagerImpl.doStart(ServiceManagerImpl.java:249) at com.newrelic.agent.service.AbstractService.start(AbstractService.java:63) at com.newrelic.agent.Agent.continuePremain(Agent.java:157) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.newrelic.bootstrap.BootstrapAgent.startAgent(BootstrapAgent.java:147) at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:84) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525) Caused by: java.lang.ClassNotFoundException: java.sql.SQLException at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 19 more

One thing to check is to make sure the newrelic.jar and its folder are not included in the classpath.

Even if I am using the api?