简体   繁体   English

在 GWT 项目中运行“ant gwtc”会出现错误“Source option 5 is no longer supported. Use 7 or later”

[英]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.

相关问题 在Eclipse中无法正常运行时,无法在jenkins中编译maven项目,“不再支持源选项6。 使用7或更高版本” - Unable to compile maven project in jenkins while it is working fine in the eclipse “Source option 6 is no longer supported. Use 7 or later” 另一个 Maven “不再支持源选项 6。使用 7 或更高版本。” - Another Maven "Source option 6 is no longer supported. Use 7 or later." Java Maven 项目“不再支持源选项 5。使用 6 或更高版本。” - Java Maven Project "Source option 5 is no longer supported. Use 6 or later." Intelij Maven:错误:不再支持源选项 6。 使用 7 或更高版本。 还有解决方案吗? - Intelij Maven : error: Source option 6 is no longer supported. Use 7 or later. Is there anymore solutions? 错误:不再支持源选项 6。 使用 7 或更高版本。 反编译 MCP 时 - error: Source option 6 is no longer supported. Use 7 or later. When decompiling MCP 我收到以下错误消息“源选项 5 不再受支持。请使用 7 或更高版本” - I am getting the following error "source option 5 is no longer supported .use 7 or later" Java 17 和 maven-archetype-quickstart 给出错误:源选项 5 不再受支持 - Java 17 and maven-archetype-quickstart gives error: Source Option 5 is no longer supported 如何处理“不再支持 resteasy.scan。使用 servlet 3.0 容器和 ResteasyServletInitializer”错误 - How to handle "resteasy.scan is no longer supported. Use a servlet 3.0 container and the ResteasyServletInitializer" Error 在ant上编译gwt项目时出错,但是在eclipse中却没有 - Error on compiling gwt project on ant but not in eclipse 运行Jbilling源代码(一个ANT项目) - Running the Jbilling source code (An ANT project)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM