Into IntelliJ 2017.1 RC, I imported a simple Maven project created with the Quickstart Archetype.
When clicking the green-bug-icon to run in debug mode, the debugger panel does appear. Clicking the View Breakpoints
icon shows that I do indeed have multiple breakpoints in place, created by clicking in the gutter of the code editor. Yet all those breakpoints are bypassed, and the code execution completes.
Is there some trick to making the IntelliJ debugger, well, debug?
I am new to IntelliJ, more familiar with NetBeans.
Terminate a debugger session Click the Stop button in the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).
To solve this, simply remove the jar of the debugged module from all modules' dependencies in the Project Structure. If you do not know which modules have the debugged module jar as dependencies, you can use some tools (Eg. Sublime Text, bash, ...) to search for the module name which is stored in Intellij *.
Practical advice that I follow: 1. mute all the breakpoints while the app is coming up 2. enable breakpoints only while debugging that flow. Of course, it won't help if you are trying to debug something which happens during app startup.
Something went wrong with the import of the Maven project into IntelliJ.
Try again.
.idea
and myapp.iml
items from project folder. Recompile MyApp.java
Debug 'MyApp.main()'
Then debugger works as expected, stopping on breakpoints.
Tip: Before importing a Maven project, edit the POM to specify a Java version as the compiler source & target. If omitted you get Maven's default of compiling as Java 5 (1.5) code. Per the Maven page, Setting the -source and -target of the Java Compiler
inject these four lines into your POM file, a pair of tags inside a properties
tag.
Here we specify Java 8 (1.8) be used by the compiler.
<project>
[...]
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
[...]
</project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With