Grails:执行脚本时出错编译:启动失败:

时间:2014-02-04 09:41:00

标签: grails startup

我已经在我的Windows XP上安装了Grails,但是当我尝试制作“grails complile”时,我遇到了错误:

| Configuring classpath
| Error Error executing script Compile: startup failed:
__Compile: 1: unexpected char: 0x0 @ line 1, column 1.
1 error
 (Use --stacktrace to see the full trace)

请提供解决此问题的解决方案。

由于

一些有用的信息: Grails版本是2.2.4

GRAILS_HOME=c:\grails    
GROOVY_HOME=C:\Program Files\Groovy 
JAVA_HOME=c:\Program Files\Java\jdk1.7.0_07 
PATH=%JAVA_HOME%\bin;c:\OpenSSL\bin;%GRAILS_HOME%\bin;%GROOVY_HOME%\bin

添加:

C:\grails\xxx>grails run-app --stacktrace
| Configuring classpath
| Error Error executing script RunApp: startup failed:
__RunApp: 1: unexpected char: 0x0 @ line 1, column 1.
1 error
 (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
__RunApp: 1: unexpected char: 0x0 @ line 1, column 1.
1 error

        at gant.Gant.compileScript(Gant.groovy:631)
        at gant.Gant.this$2$compileScript(Gant.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259)
        at gant.Gant$_closure1.doCall(Gant.groovy:129)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259)
        at gant.Gant.loadScript(Gant.groovy:266)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259)
| Error Error executing script RunApp: startup failed:
__RunApp: 1: unexpected char: 0x0 @ line 1, column 1.
1 error

1 个答案:

答案 0 :(得分:2)

与此问题类似,我认为您的错误在于使用%GRAILS_HOME%,让我们将其留给LINUX。

你可以参考我在这里回答的其他问题[1] Grails is not recognized as an internal or external command (Windows 7)

但请确保您的环境中有以下内容。

首先在CMD命令行类型

上尝试这个
echo %GRAILS_HOME%

然后输入路径并查看grails路径是否类似:

C:\Windows\system32;C:\Windows;C:\grails2.1.1

好的,如果无论如何我建议您用GRAILS_HOME替换C:\grails2.1.1

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win‌​d owsPowerShell\v1.0\;%JAVA_HOME%\bin;%GRAILS_HOME%\bin;

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win‌​d owsPowerShell\v1.0\;%JAVA_HOME%\bin;c:\grails2.1.1\bin;

然后注销或重新启动它应该工作的PC,如果没有检查你的grails包的文件名grails.bat的东西或尝试通过给出CMD的确切路径来运行它!!

喜欢:

cmd > c:\grails2.1.1\bin\startGrails.bat 

干杯,Dman !!