Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groovy: compiler mismatch after installation

I am using grails 2.3.4 with the eclipse grails plugin(GGTS). However, after installation I created a project and got:

  Description   Resource    Path    Location    Type
    Groovy: compiler mismatch Project level is: 2.1 Workspace level is 1.8
    Groovy compiler level expected by the project does not match workspace compiler level. 
    Go to Project properties -> Groovy compiler to set the Groovy compiler level for this project   test        test    Groovy compiler mismatch problem

I tried to change the compiler preferences but nothing changes...

enter image description here

I really appreciate your answer!

like image 230
Carol.Kar Avatar asked Jan 28 '14 17:01

Carol.Kar


3 Answers

You can also add an extension from the Spring Dashboard and keep using the "same" workspace.

On the sidebar of Dashboard click on "IDE EXTENSIONS".
Choose the groovy compiler that you need and click install.

After that you can customize each project to compile with a version of your choice.

Click on a project and then Project>Properties>Groovy Compiler and choose the version from the dropdown menu.

For example the latest version of Grails(2.4.0) is "buggy" under GGTS(3.5.1) until you install Groovy 2.3 Compiler extension and change your Projects properties accordingly.

Grails 2.4 doc whatsNew

UPDATE for Grails 3.0

For Grails 3.0.x you should install and use Groovy 2.4 Compiler

Grails 3.0 doc whatsNew

like image 153
fat_mike Avatar answered Oct 06 '22 12:10

fat_mike


I got same error but following option resolved it for me Right Click on Project , Go to Groovy -> Fix Compiler Mismatch Problems. Click on it , it asks for selecting the correct version of compiler select it , clean-build your application and restart it , it should work fine.

like image 33
user3614936 Avatar answered Oct 06 '22 12:10

user3614936


I'm also seeing this bug. I had to remove other compiler versions from the Eclipse configuration in order to get it working.

It's possible to pass a command line parameter for choosing the compiler version, but that didn't work for me. I hit this bug after doing that: http://jira.codehaus.org/browse/GRECLIPSE-1642

Basicly I have disabled the other Groovy compiler version by removing the lines from this file: (GGTS home directory)/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info

I'm using separate Eclipse config directories for different workspaces: https://stackoverflow.com/a/7202782/166062 This way I can work on Groovy 2.2 and Groovy 2.1 projects without having 2 complete installations of GGTS.

like image 26
Lari Hotari Avatar answered Oct 06 '22 13:10

Lari Hotari