Wednesday, June 24, 2015

How to fix "ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options." error

Did you get the error below when you tried to launch tomcat in debug mode?

"Error occurred during initialization of VM
agent library failed to init: jdwp
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options."








Here's how to fix it:
I'm using Spring STS 3.6.4 (which essentially is Eclipse tailored for Spring). So the screenshots may not exactly the same as Eclipse.
In Eclipse IDE, open the server tab.






Double click the server instance that you're trying to start. This will open the server overview tab.


















Under General Information click the "Open launch configuration link"

Select the Arguments tab













In the VM arguments text area, look for -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
 and remove it.
Click OK to save



Launch tomcat in debug again. The error should go away.

2 comments: