Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails, GGTS Setup

Tags:

grails

ggts

I need to setup a Windows working environment for Grails. I'd like to use GGTS as an IDE but got several errors compiling a sample project. Currently I'm using jdk1.8.0_40 and Grails 2.5.0. which results in this error (but in the end the project is working):

Groovy:Unexpected problem with AST transform: The Spock compiler 
plugin cannot execute because Spock 1.0.0-groovy-2.4 is not compatible 
with Groovy 2.3.10. For more information, see http://versioninfo.spockframework.org

On top of that there are two Java Exception Breakpoints which are listed as "unknown". Only info regarding version support I could find is:

Java SDK 1.5+ for Grails 1.2 or greater

GGTS itself seems not to run with the latest grails (3.0.1) since I simply cannot add it (directory appears not to be a grails installation).

Should I use Java 7 instead?

like image 502
Christian Avatar asked Apr 04 '15 14:04

Christian


People also ask

How do I set environment variables in Grails?

Download the latest Grails releasePATH under 'System variables' and GRAILS_HOME under 'User variables') Type "grails" at the command line, if a help message is displayed you are ready to start using Grails! If you get an error message, try to chmod +x the grails script inside the bin directory.

How do you set Grails path?

Before installing grails, make sure that Java SDK 1.4 or higher is installed on your machine. In a nutshell, the environmental variables should be like.. JAVA_HOME = C:\Program Files\Java\jdk-1.5 GRAILS_HOME = C:\grails PATH = %GRAILS_HOME%\bin;%JAVA_HOME%\bin; This works fine for me.

What is better Grails or Spring?

When assessing the two solutions, reviewers found Grails easier to use, set up, and do business with overall. However, reviewers preferred the ease of administration with Spring Framework. Reviewers felt that Spring Framework meets the needs of their business better than Grails.


2 Answers

This issue is not related to JDK 1.8 or 1.7, but its is related to the GGTS IDE 3.6.4 Groovy Compiler version. As the error clarifies that Spock 1.0.0 version needs Groovy 2.4 compiler.

GGTS 3.6.4.RELEASE-e4.4.2 IDE comes with Groovy 2.3.10 compiler by Default.

Install Groovy Compiler 2.4 Feature and "switch to 2.4" will resolve this issue. Refer: http://docs.codehaus.org/display/GROOVY/Compiler+Switching+within+Groovy-Eclipse

If you cannot switch compilers from the IDE Groovy Compiler preference page, follow the instructions to perform the switch from outside of Eclipse:

(Grails 2.5.0 uses Spock 1.0.0 (and internally Groovy 2.4.3 and this is why your project is compiling & working fine as the Grails runtime environment is taking over)

like image 116
acveer Avatar answered Oct 17 '22 14:10

acveer


As an additional experience report to the answer above, thus providing another solution variant: I had to use the http://dist.springsource.org/snapshot/GRECLIPSE/e4.4 update site (as opposed to the release version mentioned in the link above) to make the 2.4 compiler feature available in the update manager. After installation, the compiler errors are gone.

like image 4
fschneider Avatar answered Oct 17 '22 13:10

fschneider