3

My java web project includes some Groovy code. But eclipse is not recognizing Groovy files and not generating any classes out of it. I have installed Groovy plugin in Eclipse. Installed Groovy in my windows machine and setup GROOVY_HOME and include groovyall jar file in my lib folder. But no luck.

Please help.

Himanshu Yadav
  • 13,315
  • 46
  • 162
  • 291

2 Answers2

2

Have you converted your project into a groovy project? In order for groovy files to be compiled, they must be in a groovy project. Select Project, right-click -> Configure -> Convert to Groovy Project...

This will set up the groovy dependencies correctly. You can remove the groovy-all jar from your lib folder.

Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148
  • 3
    It's a J2EE project where I am using Groovy for specific functionality. Converting the whole project to Groovy Project would not be a good idea. – Himanshu Yadav Feb 29 '12 at 16:01
0

You could also use STS, when the dashboard opens up click on the "extensions" tab and click on the Groovy language feature and install it. Then right click on project, -> Spring -> configure groovy nature to use groovy also.

Another option is create a new Groovy project, the upshot is that you can use any java file within a groovy project since they are so well coupled.

Abe
  • 8,623
  • 10
  • 50
  • 74
  • Thanks for your help. I have resolved it by installing the groovy and setting GROOVY_HOME and adding an eclipse groovy plugin to it. – Himanshu Yadav Feb 29 '12 at 15:59