Skip to content

Conversation

@rzo1
Copy link
Contributor

@rzo1 rzo1 commented Jan 4, 2026

If TomEE is run via TomEE Maven Plugin in debug mode, the option "-Xnoagent" is added to the JVM arguments.

On Java 25 the JVM will crash as this option was deprecated in Java 22 and subsequently removed in Java 23. We should check the Java version before adding it to the startup arguments.

This PR update the options to the modern version.

@rzo1 rzo1 requested a review from jungm January 4, 2026 21:06
-Xnoagent doesn't exist in modern Java anymore.
Copy link
Member

@jungm jungm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, googling these flags real quick I also found https://docs.oracle.com/javase/6/docs/technotes/guides/jpda/conninv.html#Invocation

Sun's VM implementations require command line options to load the JDWP agent for debugging. From 5.0 onwards the -agentlib:jdwp option is used to load and specify options to the JDWP agent. For releases prior to 5.0, the -Xdebug and -Xrunjdwp options are used (the 5.0 implementation also supports the -Xdebug and -Xrunjdwp options but the newer -agentlib:jdwp option is preferable as the JDWP agent in 5.0 uses the JVM TI interface to the VM rather than the older JVMDI interface).

I think it's safe to just always use the -agentlib:jdwp over the -Xdebug -Xrunjdwp flag

@rzo1 rzo1 merged commit 3f77865 into tomee-10.x Jan 4, 2026
1 check passed
@rzo1 rzo1 deleted the TOMEE-4569 branch January 4, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants