我继承了Grails项目,并尝试使用Java 1.8在eclipse中构建它。我可以使用Java 1.7成功构建war文件,但是当我切换到1.8并重建时,我收到以下错误:
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
我已尝试按照其他帖子的建议降级到java 1.8 u31甚至u25,但我仍然遇到同样的错误。我也在Windows和Windows中尝试过。 Linux - 同样的错误。
我使用grails版本2.1.2,这可能与它有关吗?
我是grails的新手,项目中是否有可能导致问题的配置?