5

I am trying to create a grails 2.2.0 project using eclipse-jee-juno. It gives me an error

Groovy compiler level expected by the project does not match workspace compiler level. Project compiler level is: 1.8.X Workspace compiler level is 1.7.X Go to Project properties -> Groovy compiler to set the Groovy compiler level for this project.

Background: I have installed grails 2.2.0 and I am able to create and run a sample project/controller by using the command line (not eclipse)

user1811107
  • 729
  • 3
  • 18
  • 39

2 Answers2

6

Grails 2.x need groovy 1.8+ to work. In eclipse, right click your project, select 'properties' from menu and go to Groovy compiler, select groovy version 1.8.xxxx. Or you can go to 'preference' menu and change the global setting for groovy compiler version.

coderLMN
  • 3,076
  • 1
  • 21
  • 26
  • I changed it to 2.0 it gives me a similar error Groovy compiler level expected by the project does not match workspace compiler level. Project compiler level is: 2.0.X Workspace compiler level is 1.8.X Go to Project properties -> Groovy compiler to set the Groovy compiler level for this project – user1811107 Jan 07 '13 at 04:48
  • Did you try 1.8.x? I think the error message is pretty straightforward. – coderLMN Jan 07 '13 at 04:50
  • The reason I chose 2.0 because grails is supposed to work with Groovy 2.0. Having said that I changed it to 1.8 and it got rid of the compilation error, but when I try to run it - it gives me the following runtime error Error occurred during initialization of VM agent library failed to init: instrument Error opening zip file or JAR manifest missing : null – user1811107 Jan 07 '13 at 23:52
  • 2
    This is another problem. Refer to [the jira](https://issuetracker.springsource.com/browse/STS-3128) which provides a potential workaround: `go into your grails 2.2.RC4 installation directory and copy the contents of '/lib/org.springsource.springloaded' into 'lib/com.springsource.springloaded'.` – coderLMN Jan 08 '13 at 05:12
  • Why don't they make it clear on grails.org that Grails 2.x requires Groovy 1.8 and will not work with Groovy 2.x ? – Arunabh Das Jan 23 '13 at 06:34
5

Here are the steps that enabled me to run the application on grails 2.2.0.

  1. Install JDK 7
  2. Install Grails 2.2.0
  3. Install eclipse-jee-juno or GGTS
  4. Download grails-2.2.0.RC4
  5. Under GRAILS_HOME\lib, Create a directory com.springsource.springloaded with a subdirectory springloaded-core
  6. Copied contents of RC4\lib\org.springsource.springloaded into com.springsource.springloaded

Restart GGTS or Eclipse. Your GRAILS app should be up and running!

coderLMN
  • 3,076
  • 1
  • 21
  • 26
user1811107
  • 729
  • 3
  • 18
  • 39