2010-09-01 108 views
2

我正在使用jdk1.6和grails 1.3.4。我已經按照grails.org網站中的說明設置了JAVA_HOME,GRAILS_HOME和PATH變量。當我執行create-app命令我碰到下面的錯誤:執行create-app的Grails錯誤

C:\grails\grails-1.3.4>grails create-app C:\Users\Documents\Grails\helloworld Welcome to Grails 1.3.4 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\grails\grails-1.3.4

Base Directory: C:\grails\grails-1.3.4 
Resolving dependencies... 
Dependencies resolved in 2102ms. 
Running script C:\grails\grails-1.3.4\scripts\CreateApp_.groovy 
Environment set to development 
Error executing script CreateApp: java.lang.StringIndexOutOfBoundsException: Str 
ing index out of range: 1 
java.lang.StringIndexOutOfBoundsException: String index out of range: 1 
     at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391) 
     at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) 
     at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) 
     at gant.Gant.withBuildListeners(Gant.groovy:427) 
     at gant.Gant.this$2$withBuildListeners(Gant.groovy) 
     at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) 
     at gant.Gant.dispatch(Gant.groovy:415) 
     at gant.Gant.this$2$dispatch(Gant.groovy) 
     at gant.Gant.invokeMethod(Gant.groovy) 
     at gant.Gant.executeTargets(Gant.groovy:590) 
     at gant.Gant.executeTargets(Gant.groovy:589) 
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 
1 
     at java.lang.String.substring(String.java:1934) 
     at grails.util.GrailsNameUtils.getClassNameRepresentation(GrailsNameUtil 
s.java:82) 
     at grails.util.GrailsNameUtils$getClassNameRepresentation.call(Unknown S 
ource) 
     at _GrailsCreateProject_groovy$_run_closure4.doCall(_GrailsCreateProject 
_groovy:135) 
     at _GrailsCreateProject_groovy$_run_closure1.doCall(_GrailsCreateProject 
_groovy:36) 
     at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) 
     ... 10 more 
--- Nested Exception --- 
java.lang.StringIndexOutOfBoundsException: String index out of range: 1 
     at java.lang.String.substring(String.java:1934) 
     at grails.util.GrailsNameUtils.getClassNameRepresentation(GrailsNameUtil 
s.java:82) 
     at grails.util.GrailsNameUtils$getClassNameRepresentation.call(Unknown S 
ource) 
     at _GrailsCreateProject_groovy$_run_closure4.doCall(_GrailsCreateProject 
_groovy:135) 
     at _GrailsCreateProject_groovy$_run_closure1.doCall(_GrailsCreateProject 
_groovy:36) 
     at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) 
     at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) 
     at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) 
     at gant.Gant.withBuildListeners(Gant.groovy:427) 
     at gant.Gant.this$2$withBuildListeners(Gant.groovy) 
     at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) 
     at gant.Gant.dispatch(Gant.groovy:415) 
     at gant.Gant.this$2$dispatch(Gant.groovy) 
     at gant.Gant.invokeMethod(Gant.groovy) 
     at gant.Gant.executeTargets(Gant.groovy:590) 
     at gant.Gant.executeTargets(Gant.groovy:589) 
Error executing script CreateApp: java.lang.StringIndexOutOfBoundsException: Str 
ing index out of range: 1 

有一個的StringIndexOutOfBoundsException。有誰能幫我解決這個問題嗎?

感謝

SJan

+0

這是一個錯誤 - 在Grails的最新版本中,如果您未指定它,腳本將提示您輸入應用程序名稱。 – 2012-09-16 22:16:47

回答

1

create-app: The starting point for Grails. This command creates a Grails application and requires the user to specify the application name. A subdirectory within the directory the command was executed from is then created based on the entered application name.

執行此命令的正確方法:使用命令提示符

  • 瀏覽到您的工作空間目錄
  • 類型「Grails的創造,應用的HelloWorld
  • 將創建子目錄「helloworld」作爲您的工作空間目錄