【问题标题】:How to solve "[javac] error: invalid target release: 12.0.1" with command "ant run"如何使用命令“ant run”解决“[javac] 错误:无效目标版本:12.0.1”
【发布时间】:2019-08-11 06:35:18
【问题描述】:

如有错误,请检查图片

我附上了我的 build.xml 的编译代码

<target name="compile" depends="init, clean">
    <delete includeemptydirs="true" quiet="true">
        <fileset dir="${test.dest}" includes="**/*"/>
    </delete>
    <echo message="making directory..."/>
    <mkdir dir="${test.dest}"/>
    <echo message="classpath----: ${test.classpath}"/>
    <echo message="Compiling.."/>
    <javac includeantruntime="false" debug="true" destdir="${test.dest}" srcdir="${test.src}" target="12.0.1" classpath="${test.classpath}">
    </javac>
</target>

【问题讨论】:

  • 你的PATHJAVA_HOME环境变量的值是多少?

标签: java selenium selenium-webdriver ant build.xml


【解决方案1】:

您应该只在javac 任务的目标中指定Java 规范版本(或主要版本)。所以,应该是target="12",而不是target="12.0.1"

【讨论】:

    猜你喜欢
    • 2014-03-08
    • 2012-02-18
    • 1970-01-01
    • 2015-03-18
    • 1970-01-01
    • 1970-01-01
    • 2021-04-19
    • 2010-12-02
    • 1970-01-01
    相关资源
    最近更新 更多