Reputation: 3011
This might be something very simple but I cannot seem to get it right. I have a Spring MVC 3.0 application and I would like to use some groovy code.
Problem
When I add Groovy code (Groovy Classes) and I start defining my variables the IDE (SpringSource Tool Suite in my case) tells me "def cannot be resolved to a type"
What I have done
If I create a simple Groovy Project I can interchange groovy/java with no problem but now that I am adding Groovy to something that I already had it does not seem to be picking up that I am trying to do groovy in those groovy files. I have Groovy on the classpath, Groovy nature and everything. Not sure what else to do so that STS stops flagging my groovy code as errors.
Thanks.
Upvotes: 3
Views: 3585
Reputation: 133
Upvotes: 1
Reputation: 22509
You have to install a Groovy Eclipse plugin.
Open you Dashboard, click on "Extensions" tab (of the Dashboard), check the "Groovy Eclipse" option:
and click install.
Once it is installed, it'll ask you to restart Spring Tool Suite => do it.
Then right click on your project => "Configure" => "Convert to Groovy Project"
Upvotes: 4