Home Cannot build Grails app in Eclipse with Java 1.8
Reply: 0

Cannot build Grails app in Eclipse with Java 1.8

user3728
1#
user3728 Published in April 26, 2018, 7:53 am

I've inherited a Grails project and am trying to build it in eclipse with Java 1.8. I can successfully build a war file with Java 1.7 but when I switch to 1.8 and rebuild I get the following error:

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
| Error java.lang.reflect.InvocationTargetException
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
| Error     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error     at java.lang.reflect.Method.invoke(Method.java:483)
| Error     at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error     at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.NoClassDefFoundError: [Ljava/util/HashMap$Entry;
| Error     at java.lang.Class.getDeclaredMethods0(Native Method)
| Error     at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
| Error     at java.lang.Class.getDeclaredMethods(Class.java:1967)
| Error     at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:84)
| Error     at java.security.AccessController.doPrivileged(Native Method)
| Error     at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81)
| Error     at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79)
| Error     at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
| Error     at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
| Error     at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250)
| Error     at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:334)
| Error     at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:284)
| Error     at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2928)
| Error     at groovy.lang.ExpandoMetaClass.initialize(ExpandoMetaClass.java:483)
| Error     at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166)
| Error     at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182)
| Error     at groovy.util.ConfigObject.$getStaticMetaClass(ConfigObject.groovy)
| Error     at groovy.util.ConfigObject.<init>(ConfigObject.groovy)
| Error     at grails.util.AbstractBuildSettings.<init>(AbstractBuildSettings.java:33)
| Error     at grails.util.BuildSettings.<init>(BuildSettings.groovy)
| Error     at grails.util.BuildSettings.<init>(BuildSettings.groovy:749)
| Error     at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:164)
| Error     ... 6 more
| Error Caused by: java.lang.ClassNotFoundException: java.util.HashMap$Entry
| Error     at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156)
| Error     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
| Error     at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128)
| Error     at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:48)
| Error     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
| Error     ... 28 more

I've tried downgrading to java 1.8 u31 and even u25 as suggested by other posts, but I still get the same error. I've also tried in Windows & Linux – same error.

I'm using grails version 2.1.2, could that have something to do with it?

I'm brand new to grails, is it possible there is some config in the project that is causing the problem?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.406888 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO