Search code examples
debuggingnetbeansremote-debuggingnetbeans-8netbeans-8.1

Cannot add debugging sources in Netbeans


In Netbeans 8.1 I'm trying to debug some files, but Netbeans won't let me add them as debugging sources. To add the sources, I clicked Window > Debugging > Sources. Then in the Sources tab, I right-clicked and selected Add Source Root. Then I selected the source folder and clicked add, but nothing was added.


Solution

  • When I've run into this problem, it is usually because Netbeans cannot see the sources I'm trying to debug. If I'm trying to debug a project's sources, occasionally Netbeans won't allow me to add those sources. This is usually because Netbeans cannot see the sources, so I recommend the following steps:

    1. Open the project in Netbeans by clicking File > Open Project.
    2. Look at the sources of the project and ensure that the file you are trying to debug is visible there.
    3. If the file is not visible then Netbeans cannot see the sources so add the source folder to the project or reconfigure your project so that the sources are shown in the project in Netbeans.
    4. If the sources have not already been added as debugging source, add them using the steps you mentioned.