Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA Alternate source while debugging

Env:

Mac OS
IDEA Community Edition 15

Hi,

I am currently facing two issues while remote debugging. Googled around but haven't been able to fix'em.

  1. Despite the source code being available within the project, the debugger always stops in the maven sources. Question : Is there a setting/workaround that boils down to "Prefer project modules over maven sources while debugging" ?
  2. Idea showed a popup showing the alternate sources initially. After selecting local module i disabled it. Now i can not re-enable it (for other local modules). The intended behaviour was that it automatically goes to local module source but that not working. Not irritating enough, Preferences -> Build -> Debugger -> "Show alternate source switcher" is not working. It always keeps disabled no matter what i do.

Any inputs are much appreciated.

Rakesh

Update

Solution for #2 is to do it the hard way. Open up

/Users/user-name-here/Library/Preferences/IdeaIC15/options/other.xml

and set 'SHOW_ALTERNATIVE_SOURCE' to true i.e.

<option name="SHOW_ALTERNATIVE_SOURCE" value="true" />

and restart IDEA

like image 308
Rakesh Kumar Cherukuri Avatar asked May 31 '26 18:05

Rakesh Kumar Cherukuri


1 Answers

Even I had the same problem. I had external jars files attached in the Project_Structure -> Modules -> Dependencies. I did the following trick, it worked for me and it is not the remote debugging. I attached the source code of those jar files in Project_Structure -> Libraries and click the + in the second window pane (I am using Intellij Idea Ultimate 2018.2) then java option in the drop-down list. After selecting java option, a file browser window will open up, choose the source code directory you want to attach during the debugging.

like image 150
Gunasekar Avatar answered Jun 02 '26 20:06

Gunasekar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!