Java Debugger bytecode not synchronized with source code

Answered

I have a simple maven project with one test. I have couple of breakpoints in the source classes. From some reason one of the classes won't get synchronized correctly and when I set a break point there I get a message "Source code does not match the  byte code". I've tried everything what I found in forums with people having similar problems (mostly they complain about remote debugging or debugging on a device, but I have a normal simple maven project) - I've invalidated the caches, rebuilt index, recompiled class/module/project, etc... Still I cannot get this working. I use IntelliJ Idea 2018.3.

1
4 comments
Avatar
Permanently deleted user

Unfortunately I cannot share the project source code.I was hopping for somebody having the same issue. Maybe I should mention that I am also using the Eclipse Code Formatter plugin if that could affect this issue somehow. The project is maven project, containing a lot of maven modules all linked to the one PARENT. The project I am having troubles with is within the project directory structure but is a separate project (not linked to the PARENT).

0

You can try to replicate the issue with a dummy project having similar structure, but without the code you can't share: https://stackoverflow.com/help/mcve.

I'm afraid it would be hard to find the solution otherwise.

0
Avatar
Permanently deleted user

I understand. I will try to create a sample project like mine. In the meanwhile, I've observed, that it might be connected to the thing, that this project is located inside a directory structure of another maven project, which is the one opened through File -> Open. If I open the inner project in a separate window, everything seems to work. So maybe working in one workspace in one window with multiple separate maven projects is not the best idea. Or maybe, if the main project cannot be built, Intellij will also not update the compiled classes for the other ones.

0

Please sign in to leave a comment.