2016-10-01 62 views
0

我無法創建Grails應用程序在Netbeans IDE中,My IDE讓我創建新的Grails應用程序,當我單擊創建按鈕時,它會在控制檯中顯示錯誤。Grails應用程序在Netbeans中創建錯誤

Java版本:1.6
GRAILS VERSION:2.3.7 IDE:NetBeans的

java.lang.reflect.InvocationTargetException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:235) 
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:263) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:235) 
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:263) 

所致:java.lang.NoClassDefFoundError:的JLine /控制檯/完成者/ CompletionHandler 在org.codehaus.groovy .grails.cli.GrailsS​​criptRunner.main(GrailsS​​criptRunner.java:129) ... 12更多 引起:java.lang.ClassNotFoundException:jline.console.completer.CompletionHandler at org.codehaus.groovy.tools.RootLoader。 findClass(RootLoader.java:175) at jav a.lang.ClassLoader.loadClass(ClassLoader.java:425) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147) at org.codehaus.groovy.grails.cli.support.GrailsRootLoader。的loadClass(GrailsRootLoader.java:51) 在java.lang.ClassLoader.loadClass(ClassLoader.java:358) ...... 13多個

+0

Java 1.6?!?!?!? –

回答

2

首先,我會建議您檢查您的Java版本。

雖然Grails框架2.3.7的最低要求是Java 1.6的,你可以在Grails introduction web site看到:

這裏是主要的段落描述它:

Before installing Grails you will need as a minimum a Java Development Kit (JDK) installed version 1.6 or above. Download the appropriate JDK for your operating system, run the installer, and then set up an environment variable called JAVA_HOME pointing to the location of this installation.

我會建議使用更先進JAVA版本,如1.7或1.8。尤其是1.8版本,它提供了從較早的JAVA版本的絕大多數更改和改進。

應該檢查的另一件事是你的JAVA_HOME(環境變量)值。你確定它指向相關的JAVA JDK嗎?如果不是這樣,這可能是你錯誤的一個很好的理由。

個人而言,我現在用IntelliJ IDEA的(JetBrains的IDE),它與Grails的偉大工程使用搖籃建築工具框架。