0

I have a problem when trying to compile a project using "grails compile". I get the following error:

| Configuring classpath
| Error Error executing script Compile: startup failed:
_GrailsClasspath_groovy: 17: unable to resolve class 
org.codehaus.groovy.grails.compiler.GrailsProjectCompiler
@ line 17, column 1.

I am very new with groovy/grails, but I assume this is a problem with some classpath somewhere. However, I can't find any file containing the string "GrailsProjectCompiler" in my project. I tried searching google and stackoverflow for similar problems, but the only one I found (http://grails.1312388.n4.nabble.com/Unable-to-resolve-class-org-codehaus-groovy-grails-compiler-GrailsProjectCompiler-td4641043.html) did not work for me.

Does any one have any suggestions as to what could be wrong?

Edit: Grails is version 2.3, this is Mac OS X El Capitan running JDK 1.8

MrMalt
  • 42
  • 7

1 Answers1

0

As mentioned in question: Does Grails 2.3.x Support JDK 8

Support for Java 8 had been added since Grails 2.4.

Try JAVA 1.7

Community
  • 1
  • 1
Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59
  • While this is good advice, I do not believe this will fix my problem, as the project was running a while ago (with java 1.8). This problem first occurred when I moved dependencies from codehaus to maven central (I know codehaus is taken down, this is a legacy project at my firm, and hadn't been updated for a long while). Will try tomorrow though! – MrMalt Apr 07 '16 at 10:55
  • No dice. Java 1.7 did not help. – MrMalt Apr 08 '16 at 06:43
  • Did you try classic `grails clean` and `grails compile --non-interactive --refresh-dependencies` before `grails run-app`? – Michal_Szulc Apr 08 '16 at 08:23
  • I tried that. But I get this error: "_GrailsClean_groovy: 33: unable to resolve class GrailsProjectCleaner" – MrMalt Apr 08 '16 at 11:40
  • Which ide are you using? Does error occur if you run project from console? Did you try to re-import project? – Michal_Szulc Apr 08 '16 at 13:07
  • There were a lot of issues with the project. In the end it turned out to be incompatible with the combination of java and grails versions specified in the project documentation, and a bunch of dependency issues because of this. Thanks for your help though! Your answer pointed me in the right direction. – MrMalt Apr 22 '16 at 09:44