Reputation: 11
I used below command to activate jmx and also needed javaagent in my program and it worked fine in java 11. the command is as below:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8071
-javaagent:D:\resources\aspectjweaver-1.9.7.jar -jar app.jar
but when i upgraded java to java 17 program exit unexpectedly without any exception. does java 17 need any circumstances in order to use java options with java tool options?
any help would be appreciated.
I define JAVA_TOOL_OPTIONS environment variable but my problem doesn't fix.
Upvotes: 0
Views: 1066
Reputation: 67437
You can use AspectJ Weaver 1.9.7 on Java 17+ if and only if the bytecode you want to weave only consists of classes compiled to targets <= Java 16. Otherwise, please upgrade to a more recent AspectJ version, ideally the latest 1.9.9.1.
Please also note that in order to use LTW (load-time weaving) on Java 16+, you need to add --add-opens java.base/java.lang=ALL-UNNAMED
to the Java command line, as described in the release notes. Even the 1.9.7 release notes contain that information.
Upvotes: 2