Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA Remote Debug invalid breakpoints

Hello, everybody!

I am trying to debug my java8 application running on tomcat 7 with Intellij IDEA Remote Debug. The problem is when i run debug in idea all off my breakpoints are set to invalid with message:

Line numbers info is not available in class pathToClass

Here is my JAVA_OPTS settings from catalina.bat:

set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999 %JSSE_OPTS%"

Here is my remote debug settins from IDEA

like image 538
bearbeard Avatar asked Dec 28 '17 07:12

bearbeard


People also ask

Why is breakpoint invalid IntelliJ?

If it is technically impossible to suspend the program at the breakpoint, the debugger marks it as invalid. The most common cause for this is that there is no executable code on the line.

Why debug is not working in IntelliJ?

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 *.

Why are my breakpoints not hitting?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.


1 Answers

At one point in your build process your Java code is compiled in to classes with the javac compiler (or something equivalent). There is an option to the compiler to include debug information (including line numbers) which you apparently do not have enabled at the moment.

For plain javac add -g.

For ant add debug="true" to the javac task.

For Maven, the default configuration for the maven-compiler-plugin adds debug information, so the explicit setting not to has to be undone.

like image 79
Thorbjørn Ravn Andersen Avatar answered Sep 30 '22 09:09

Thorbjørn Ravn Andersen