我已经在我的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
答案 0 :(得分:2)
你可以参考我在这里回答的其他问题[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\Wind owsPowerShell\v1.0\;%JAVA_HOME%\bin;%GRAILS_HOME%\bin;
与
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind 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 !!