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