Can't debug Java program in Intellij IDEA
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开发者_如何学C such behaviour?
If you're talking about debugging something running in Maven with IntelliJ, you can
- 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.
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.
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.
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
Sounds like the same bug in the Java VM, I just ran into: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862295
The stated workaround was to use the -XX:+UseParallelGC on the Java VM.
It's not an IDE problem.
That solution was worked for me;
File-->Invalidate Caches-->Tick The Clear CheckBoxes --> Restart
Have a nice day.
精彩评论