无法在Intellij IDEA中调试Java程序
第一次遇到无法在Intellij IDEA中调试Java程序的问题。输出到命令行有效,但断点被忽略。 可能是因为我创建了 Maven 配置来启动程序。 可能是我与 JVM 断开连接,但我不知道如何连接。 造成这种行为的原因是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您正在谈论使用 IntelliJ 调试 Maven 中运行的某些内容,您可以
mvnDebug
而不仅仅是mvn< 运行构建/代码>。它将等待调试器连接到端口 8000。您可以让 IntelliJ 通过创建连接到 localhost:8000 的“远程”类型的运行/调试配置来执行此操作。
If you're talking about debugging something running in Maven with IntelliJ, you can
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.如果您遇到未触发的断点,请参阅以下内容:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003676199-Can-t-debug-any-Java-or-Kotlin-application
在我的情况下禁用android插件解决了这个问题。
If you are facing with non-triggered breakpoints, see following:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003676199-Can-t-debug-any-Java-or-Kotlin-application
In my case disabling android plugins solved the problem.
该解决方案对我有用;
祝你有美好的一天。
That solution was worked for me;
Have a nice day.
我的解决方案是 IntelliJ 中的以下内容。转到:
设置->构建、执行、部署->构建工具 -> Maven-> Runner
确保取消选中“将 IDE 构建/运行操作委托给 Maven”框。
之后,我可以进行调试并且断点可以正常工作。
My solution was the following in IntelliJ. Go to:
Settings -> Build, Execution, Deployment-> Build Tools -> Maven -> Runner
Make sure to uncheck the box 'Delegate IDE build/run actions to Maven'
After that, I could debug and the breakpoints worked properly.
请记住,Maven 和 IDEA 使用单独的构建过程。讽刺的是,我今天才成功地使用以下方法在浏览器中构建、部署并运行了我自己的应用程序:
Maven 3.0
Tomcat 7.0.5 与 tomcat-maven-plugin
IDEA IU 版本 10
所以询问您是否需要帮助。
丝兰
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
So ask if you need a hand.
Yucca
听起来像是 Java VM 中的相同错误,我刚刚遇到了:
https://bugs.java.com/bugdatabase/view_bug?bug_id=6862295
规定的解决方法是在 Java VM 上使用 -XX:+UseParallelGC。
这不是IDE问题。
Sounds like the same bug in the Java VM, I just ran into:
https://bugs.java.com/bugdatabase/view_bug?bug_id=6862295
The stated workaround was to use the -XX:+UseParallelGC on the Java VM.
It's not an IDE problem.