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?
-
did you try a clean build? are you sure you are running with a debug task? is this a standalone java program or something running in a container?hvgotcodes– hvgotcodes2011-08-23 18:46:46 +00:00Commented Aug 23, 2011 at 18:46
-
Hi, this is standalone java program. I described the process I do as comment to another answer.Konstantin Milyutin– Konstantin Milyutin2011-08-23 19:02:02 +00:00Commented Aug 23, 2011 at 19:02
Add a comment
|
6 Answers
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
mvnDebuginstead 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.
3 Comments
Konstantin Milyutin
Thank you for answering. I created a configuration in IDEA analogous to the command line version: mvn clean test -P launch. So, I'm using first option you wrote. But it simply doesn't stop
Konstantin Milyutin
Thank you @Ryan, second way is working. If you can help me with first one, would be very nice!
Ryan Stewart
Surefire forks a process for running tests, which can mess with debugging. One way to overcome it is by adding
-DforkMode=never to your mvn command line (put it in the "Goals" box in IntelliJ).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.
Comments
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.
1 Comment
Gank
but:
Error running Unnamed Invalid arguments : Already listening [timeout, port, localAddress]