Groovy/Grails unable to resolve class – even if the class is in the same package

The Problem

Every now and then I get this annoying problem in GGTS (Grails/Groovy Tool Suite – Version 3.6.2.RELEASE at the time of this writing), where the IDE just complains about how it can’t resolve a class.  The weird thing is that the file that the IDE is complaining about is in the same package as the class that I’m trying to use.  It built before, and the source hadn’t changed – so clearly this should not be happening.

The Fix

Hitting the Clean button on the Eclipse side (Project -> Clean) seems to make the errors go away.

This apparently has been a problem since June 2010 (forum post reference here), so I’m surprised that it is still an issue in the current version.

Making Eclipse More Like Visual Studio

I’m very used to using Visual Studio for C++ and what not, but when I write Java on Eclipse, I’m not quite used to the interface, so I decided to make Eclipse more like Visual Studio.

Color Theme, Whitespace, and Intellisense (Code Completion)

I pretty much followed this guide: http://www.jackyliang.com/jackyresumecoding/2014/4/5/make-eclipse-work-more-like-visual-studio

For the whitespace section, the download link at the above site was broken, so I got the whitespace settings from here instead: http://www.webbiscuit.co.uk/making-eclipse-more-like-visual-studio/


This guide: http://stackoverflow.com/questions/200499/visual-studios-keybindings-for-eclipse, Chris’s answer (not the chosen answer)


I solved this by not using the Eclipse Debug Perspective and just moving the debugger windows like I would in Visual Studio.  The other windows can be moved around within Eclipse to be more like Visual Studio.

© 2019 Henry Poon's Blog

Theme by Anders NorénUp ↑