在带有 Tomcat7 和 IDEA IntelliJ 12 的 OSX 上。
运行配置工作正常。调试配置抱怨:
/usr/local/Cellar/tomcat/7.0.37/libexec/bin/catalina.sh run
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.
Disconnected from server
我从 11 年找到了这篇文章,但没有帮助。
关于“一旦我从系统变量中删除它(在 IDEA 中它是只读的)问题已修复”的注释是有道理的。所以我尝试从 catalina.sh 中删除整个块
if [ -z "$JPDA_OPTS" ]; then
JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
fi
没有帮助。任何帮助将不胜感激。谢谢!
java运行命令:
+ eval exec '"/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java"' '"-Djava.util.logging.config.file=/Users/ryan/Library/Caches/IntelliJIdea12/tomcat/Unnamed_secure_post_3/conf/logging.properties"' -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:65523,suspend=y,server=n -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager '-Djava.endorsed.dirs="/usr/local/Cellar/tomcat/7.0.37/libexec/endorsed"' -classpath '"/usr/local/Cellar/tomcat/7.0.37/libexec/bin/bootstrap.jar:/usr/local/Cellar/tomcat/7.0.37/libexec/bin/tomcat-juli.jar"' '-Dcatalina.base="/Users/ryan/Library/Caches/IntelliJIdea12/tomcat/Unnamed_secure_post_3"' '-Dcatalina.home="/usr/local/Cellar/tomcat/7.0.37/libexec"' '-Djava.io.tmpdir="/usr/local/Cellar/tomcat/7.0.37/libexec/temp"' org.apache.catalina.startup.Bootstrap start