[英]Running "ant gwtc" in GWT project gives error "Source option 5 is no longer supported. Use 7 or later"
I have a GWT project that I haven't built for a while, although I don't think much has changed.我有一个 GWT 项目,我已经有一段时间没有构建了,尽管我认为没有太大变化。
When I run当我跑步时
ant gwtc
I get the output:我得到 output:
Buildfile: .../build.xml
libs:
javac:
[javac] .../build.xml:31: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 4 source files to .../war/WEB-INF/classes
[javac] error: Source option 5 is no longer supported. Use 7 or later.
[javac] error: Target option 5 is no longer supported. Use 7 or later.
BUILD FAILED
.../build.xml:31: Compile failed; see the compiler error output for details.
Within the generated build.xml file I found this block:在生成的 build.xml 文件中,我发现了这个块:
<target name="javac" depends="libs" description="Compile java source to bytecode">
<mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src" includes="**" encoding="utf-8"
destdir="war/WEB-INF/classes"
source="1.5" target="1.5" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
And changed the source and target lines to 1.7.并将源和目标行更改为 1.7。
<target name="javac" depends="libs" description="Compile java source to bytecode">
<mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src" includes="**" encoding="utf-8"
destdir="war/WEB-INF/classes"
source="1.7" target="1.7" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.