Groovy: compiler mismatch after installation
Asked Answered
Y

3

8

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!

Yazzie answered 28/1, 2014 at 17:49 Comment(0)
M
11

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

Millhon answered 23/5, 2014 at 15:8 Comment(0)
E
7

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.

Erubescence answered 20/1, 2015 at 12:33 Comment(0)
T
1

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://mcmap.net/q/930321/-disable-eclipse-plugins-per-workspace This way I can work on Groovy 2.2 and Groovy 2.1 projects without having 2 complete installations of GGTS.

Teniacide answered 29/1, 2014 at 8:13 Comment(2)
as a sidenote, I've later noticed that there is problems in the compiler selection if you have "-clean" in the startup parameters of GGTS/Eclipse. I had been using "-clean" in my custom Eclipse startup paramaters and that was causing some problems. "-clean" is not a default setting.Teniacide
Thanks! I couldn't see newly-installed compiler versions, but -clean fixed it.Angelo

© 2022 - 2024 — McMap. All rights reserved.