Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Debugger catching wrong file with same name

Tags:

I have two files with same name in two separate packages package1 and package2 in same maven project. I added a debug point at line i in the file that is present in package1. But while debugging, the IntelliJ IDEA debugger stops at line i of the file present in package2. This has been occurring with a few of my fellow mates as well. Is there any such bug reported with IntelliJ ? Any fix or workaround ?

like image 990
Puneet Chaurasia Avatar asked Aug 23 '16 10:08

Puneet Chaurasia


People also ask

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

How do I Debug an error in IntelliJ?

Run the program in debug modeClick the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.

How do I Debug multiple threads in IntelliJ?

Start the debug session by clicking the Run button near the main method and selecting Debug. When the program has run, both threads are individually suspended in the addIfAbsent method. Now you can switch between the threads (in the Frames or Threads tab) and control the execution of each thread.

How do I move from one Debug point to another in IntelliJ?

You can press F8 to step to the next statement and f9 to step to the next breakpoint. As you step through your application, the corresponding information appears in the debugger window.


1 Answers

You can turn on Show alternative source switcher flag under Settings >> Build, Execution, Deployment >> Debugger.

Check show alternative source switcher check box, and IntelliJ IDEA will allow you to change required file.

Now, when you are debugging, IntelliJ IDEA should provide you other options to chose among source files.

like image 158
ckarabulut Avatar answered Sep 21 '22 17:09

ckarabulut