无法在 Intellij IDEA 中调试 Java 程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7165956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't debug Java program in Intellij IDEA
提问by damluar
For the first time I encounter problem when I can't debug Java program in Intellij IDEA. Output to command line works, but breakpoint is ignored.. May be it's because I created Maven configuration to start the program. It might be that I'm disconnected from JVM, but I have no idea how to connect to. What can be the cause of such behaviour?
第一次遇到Intellij IDEA中无法调试Java程序的问题。输出到命令行有效,但断点被忽略.. 可能是因为我创建了 Maven 配置来启动程序。可能是我与 JVM 断开了连接,但我不知道如何连接。这种行为的原因是什么?
回答by Ryan Stewart
If you're talking about debugging something running in Maven with IntelliJ, you can
如果你正在谈论使用 IntelliJ 调试在 Maven 中运行的东西,你可以
- Run the maven build through IntelliJ and debug it like anything else, or
- Run your build using
mvnDebug
instead of justmvn
. It will wait for a debugger to connect on port 8000. You can have IntelliJ do this by creating a Run/Debug Configuration of type "Remote" that connects to localhost:8000.
- 通过 IntelliJ 运行 Maven 构建并像其他任何事情一样调试它,或者
- 使用
mvnDebug
而不仅仅是mvn
. 它将等待调试器连接到端口 8000。您可以通过创建连接到 localhost:8000 的“远程”类型的运行/调试配置来让 IntelliJ 执行此操作。
回答by thejartender
Remember that Maven and IDEA use separate build processes. Ironically I only managed today to get my own app built,deployed and run in browser today using: Maven 3.0 Tomcat 7.0.5 with tomcat-maven-plugin IDEA IU version 10
请记住,Maven 和 IDEA 使用单独的构建过程。具有讽刺意味的是,我今天才设法在浏览器中构建、部署和运行我自己的应用程序:Maven 3.0 Tomcat 7.0.5 with tomcat-maven-plugin IDEA IU version 10
So ask if you need a hand.
所以问问你是否需要帮助。
Yucca
丝兰
回答by Paul
Sounds like the same bug in the Java VM, I just ran into: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862295
听起来像 Java VM 中的相同错误,我刚遇到:http: //bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862295
The stated workaround was to use the -XX:+UseParallelGC on the Java VM.
所述的解决方法是在 Java VM 上使用 -XX:+UseParallelGC。
It's not an IDE problem.
这不是IDE问题。