2009-08-21 71 views
2

我正在尝试遵循Grails教程的一些介绍,并且希望尝试查看是否可以在Eclipse中使用调试器以及我的Grails应用程序。我的Grails应用程序运行正常,当我用它来执行命令,但是当我试图使用Eclipse运行配置,我得到以下错误:Eclipse中的Grails

Exception in thread "main" java.lang.NullPointerException 
at java.io.File.<init>(File.java:194) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) 
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:107) 
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:192) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:200) 
at grails.util.GrailsMain.run(GrailsMain.groovy:27) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) 
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1062) 
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:893) 
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:744) 
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:727) 
at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:383) 
at org.codehaus.groovy.runtime.InvokerHelper$runScript.call(Unknown Source) 
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) 
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:129) 
at grails.util.GrailsMain.main(GrailsMain.groovy) 

我想,这是一个配置问题(我最近设置了GRAILS_HOME环境变量,这似乎是正确的),但该错误消息并没有真正给我很多去。

对此提出建议?

+0

使用STS(Spring工具套件)。一步一步的安装说明(Windows或Linux)+有用的介绍教程可以在这里找到,http://www.grailsexample.net/course-outline/。按照这个,你应该全部设置。事先确定使用下载Groovy的提示;手动指定要使用的groovy版本使得升级到新版本比让IDE为您执行更容易。 – MikeOB 2012-12-07 14:40:32

回答

0

我从来没有能够让grails在日食中正常工作。你可能想尝试Netbeans,虽然6.7版本已经改进了对Grails的支持。

+0

在eclipse中必须有某种方式。 Sts是一个选项 – 2015-07-10 12:38:16

1

除了grails home之外,试试设置JAVA_HOME环境变量。

5

Grails在Eclipse中工作。基于我的观察,我实际上会说它是Grails开发的首选IDE(以及STS版本)。

A)你可以选择安装在Eclipse的Groovy插件。可有点繁琐http://groovy.codehaus.org/Eclipse+Plugin

B)或者你可以使用Spring的工具套件(STS)IDE和安装的Grails从扩展菜单支持。 http://grails.org/STS+Integration(只是工作!)

STS是基于Eclipse

我个人发现STS有更好的Grails的支持比Netbeans的。它由支持Grails的相同组织开发。