LIbGDX – Debugging in Netbeans.

When I use NetBeans with libgdx I kept running into an issue when trying to debug the project, and make use of breakpoints etc. Clicking the debug button within Netbeans would just spew out a bunch of errors and I’d not be able to debug the project. There is a simple way around this.

Every time I started a new project I forgot to make a note of how I fixed this, and thus had to re-google etc.

All you need to do, is edit the build.gradle file under the desktop component.

Desktop -> Build Scripts -> Project -> build.gradle

Add the following in that file.

I added the above after the task run segment.

This allows me to debug from NetBeans with no errors.