I have a grails project, recently nothing compiles.
in eclipse on the Problems tab I see 100 out of 300 problems, most of them are Groovy:Internal groovy compiler error. every class has a red X on it, if I add an empty line in the file and save it the error would go away but not for long.
I had tried Build / Clean (both eclipse's and grails') / Refresh Dependencies / Compile in any possible combination. The run-app command works from eclipse with no issues. but eclipse is going crazy because I have so many errors. The only way I could make the errors go away is to disable eclipse's Build Automatically option and clean (without allowing it to build after)
Does anyone has an Idea ?
Current GGTS settings
Windows -> Preferences -> Java -> Installed JREs == jdk1.8.0_11
Windows -> Preferences -> Groovy -> Compiler == 2.3.3
Windows -> Preferences -> Groovy -> Grails == Grails 2.4.2
Help -> About Groovy/Grails Tool Suite == Version: 3.6.0.RELEASE
You can change your compiler level in (your workspace)/.settings/org.eclipse.jdt.groovy.core.prefs
We had this same problem with a project we had upgraded, switched from
groovy.compiler.level=23
to
groovy.compiler.level=21
and all the errors went away.
Seems like you're experiencing some sort of mismatch between versions of Java, Groovy Compiler and Grails. Perhaps your Groovy compiler is the latest 2.3.x from the update site but Grails version is lower than latest. Try starting GGTS 3.6 with Java 8 VM also set it as currently installed JRE in the preferences, set Groovy compiler to 2.3.3 and use Grails 2.4.1 or later.
Groovy below 2.3 and Grails below 2.4 don't support Java 8. I'd play around with the versions of Java, Groovy compiler in Eclipse preferences and Grails version to fix this problem.
Related
I am getting a message for when I start a new Grails project that project level is 2.1 and workspace level is 2.0.
When I go to preferences>Groovy>compiler it say the current version that I have is 2.0.7.
I have also tried right clicking on the project and then choosing Groovy>fix compiler mismatch problems.
I am using eclipse Kepler j2ee on a mac and using grails 2.3.3. How can I fix the program?
I think you should change your groovy compiler version to 2.1.5
Currently i use Grails.2.3.0 under preference->grails
and my groovy has been selected like this one You are currently using Groovy Compiler 2.1.5
There is a Switch to Selection for Groovy Compilers --but i suggest
Makes usre your groovy package has been insatlled or package is not corrupted and correct.
Change or install groovy compiler 2.1.5 that works fine with Grails 2.3.0 or Grails 2.3.3
and Make Refresh Dependency To your Project...
Right click on project. Go to Properties.
I am using latest GGTS v3.4 based on eclipse 4.3.1 64bit version for development app on Grails 2.3.2. Every single controller that is in my classpath has an error in it. There are two identical errors per every controller class.
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'package.SomeController'.
SomeController.groovy /appname/grails-app/controllers/package line 1
Java Problem
Everything just work, but my Problems tab is getting quite messy.
This seems to be a problem when you run GGTS with JDK8. Switching to JDK7 fixes the problem until the problem is fixed.
See issue comments of STS-3696
I usually have this issue in GGTS whenever I start a project. Look at your Project properties and check to make sure the correct version of Groovy is selected for the workspace.
I'll find the Groovy version is set to 1.8 when I'm using 2.0.
Upgrading to Grails 2.4.4 fixed the issue for me.
My conf of GGTS is:
Version: 3.6.3.RELEASE
Platform: Eclipse Kepler SR2 (4.3.2)
JDK 1.7
It could be one of several reasons.
Grails Version in Window -> Preference -> Groovy -> Grails.
Groovy Version in Window -> Preference -> Groovy -> Compiler.
Java Version is not set correctly. It's your PATH instead of under Window -> Preference -> Java -> Installed JREs. If it doesn't match the Groovy/Grails for your workspace/project, there would be error.
For example, I run into this problem when I am using Grails 2.3.1, Groovy 2.1.8. My Java version is 1.8, which is incompatible with Groovy 2.1.8. I changed it to 1.7, restarted GGTS, the problems are gone.
vvSo hi guys, im tryin to install groovy 1.7 plugin to my eclipse indigo but i can't..
I followed instructions on this page but unfortunetly it doesn't work.
What i mean by doesn't work?
Even without installing 2.0 compiler i have it
After installing Groovy-Eclipse without the extra compilers, the Groovy 1.8 compiler is active by default. And the Groovy 2.0 compiler becomes active after installing the extra compiler.
And as it says i shouldn't have but well meaby its an old description.
Then i'm goin to Preferences -> Groovy -> Compiler page, and guess what i can only switch to 1.8.6.xx-MORENUMBERS-e37-REALEASE. When i do i only can switch back to 2.0.7.xx-MORENUMBERS-e37-REALEASE.
So where is this 1.7 compiler because i dont see it there?
So i followed up with adding to eclipse.ini -groovy.compiler.level 17, still doesn't work.
I tried to change file bundles.info, but there is no 1.7 version.
So someone know how i can get this compiler 1.7? I was searching it so long, and i only found Groovy Eclipse plugin that only operates on 2 version (above one).
Thanks in advance for an answer!
It's been a while since i last saw 1.7 in the plugin. I guess it got outdated and removed. This page (near the bottom) tells that Groovy 1.7 is deprecated for GGTS (which, i guess, uses Groovy-eclipse):
Deprecating of Groovy 1.7 support
The Groovy 1.7 support in GGTS has been deprecated. It is still possible to install it for this release, but it will be removed in future releases. If you need to install the Groovy 1.7 compiler, then:
Go to Help -> Install new software
Choose the Springsource update site to work with
Uncheck Group items by category, As shown in the image:
Is that doesn't work, maybe you can try to install an older version of Groovy-eclipse from http://dist.springsource.org/.
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)
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.
Here are the steps that enabled me to run the application on grails 2.2.0.
Install JDK 7
Install Grails 2.2.0
Install eclipse-jee-juno or GGTS
Download grails-2.2.0.RC4
Under GRAILS_HOME\lib, Create a directory com.springsource.springloaded with a subdirectory springloaded-core
Copied contents of RC4\lib\org.springsource.springloaded into com.springsource.springloaded
Restart GGTS or Eclipse. Your GRAILS app should be up and running!
I have a plugin which is compiled with JDK 1.5. If I change the compiler to JDK 1.6, I will get some compilation errors. So, I set the Java >Compiler preference to JDK 1.5.
Now I need to create a feature patch with that plugin specified in the feature patch. The feature patch gets created without errors. But when I export the feature patch project as a deployable feature, I get the same compilation errors above; like the IDE reverted to JDK 1.6. How do I force the build here to use JDK 1.5?
THANK YOU!
I'm not quite sure, but try this out:
Windows -> preferences -> Java -> Compiler -> compiler compliance -> 1.5
Windows -> preferences -> Java -> Installed JRE -> set up an 1.5 (download and install one, if there is only 1.6)