7

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?

2
  • 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? Commented Aug 23, 2011 at 18:46
  • Hi, this is standalone java program. I described the process I do as comment to another answer. Commented Aug 23, 2011 at 19:02

6 Answers 6

7

If you're talking about debugging something running in Maven with IntelliJ, you can

  1. Run the maven build through IntelliJ and debug it like anything else, or
  2. Run your build using mvnDebug instead of just mvn. 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.
Sign up to request clarification or add additional context in comments.

3 Comments

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
Thank you @Ryan, second way is working. If you can help me with first one, would be very nice!
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).
3

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

3

That solution was worked for me;

File-->Invalidate Caches-->Tick The Clear CheckBoxes --> Restart

Have a nice day.

Comments

1

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.

Comments

0

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

Comments

0

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

but: Error running Unnamed Invalid arguments : Already listening [timeout, port, localAddress]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.