java - 无法在项目 dbproxy 上执行目标 org.apache.maven.plugins :maven-compiler-plugin:3. 0:编译(默认编译):

标签 java maven-plugin hue

启动应用程序时出现以下错误:

Error:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.091 s
[INFO] Finished at: 2019-11-29T09:36:53Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project dbproxy: Fatal error compiling: error: invalid target release: 13.0.1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Makefile:53: recipe for target '/root/hue/desktop/libs/librdbms/java-lib/dbproxy-1.0.jar' failed
make[2]: *** [/root/hue/desktop/libs/librdbms/java-lib/dbproxy-1.0.jar] Error 1
make[2]: Leaving directory '/root/hue/desktop/libs/librdbms'
Makefile:106: recipe for target '.recursive-env-install/libs/librdbms' failed
make[1]: *** [.recursive-env-install/libs/librdbms] Error 2
make[1]: Leaving directory '/root/hue/desktop'``
Makefile:148: recipe for target 'desktop' failed
make: *** [desktop] Error 2

mvn --版本 Apache Maven 3.6.0 Maven 主目录:/usr/share/maven Java版本:13.0.1,供应商:Oracle Corporation,运行时:/usr/local/java 默认区域设置:en,平台编码:UTF-8 操作系统名称:“linux”,版本:“4.15.0-52-generic”,arch:“amd64”,系列:“unix”

openjdk 13.0.1 2019-10-15 OpenJDK 运行时环境(版本 13.0.1+9) OpenJDK 64位服务器VM(构建13.0.1+9,混合模式,共享)

请帮我解决这个问题。

最佳答案

你的错误提示

Fatal error compiling: error: invalid target release: 13.0.1

您正在使用maven-compiler-plugin 3.0,但是您至少需要 3.8 才能使用 Java 13。这可以通过 <plugin> 来完成标签,尽管您可能应该考虑将 Maven 更新到 3.5:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
        <source>13</source>
        <target>13</target>
    </configuration>
</plugin>

看看this article了解使用 Java 13 还需要什么。

关于java - 无法在项目 dbproxy 上执行目标 org.apache.maven.plugins :maven-compiler-plugin:3. 0:编译(默认编译):,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59102615/

相关文章:

c# - 在 windows 中使用 java + php

java - 尝试从构建多部分的 Objective-C 文本在 Java 中构建多部分实体

java - 该数组只能写入,不能读取

java - 使用 Stax 解析器解析 XML 1.1 文档时出现错误

hadoop - Cloudera Hue运行WordCount

sql - 执行左外部联接时,配置单元中的日期过滤器

hadoop - 色相可以安装在hadoop上而没有CENTOS上的ambari,cloudera或hortonworks之类的任何发行版吗?

java - 编辑: How do I set variables in a Project pom from a Maven Plugin?

maven-jaxb2-plugin 失败,必须存在 JAXB 版本属性

java - 离线执行 com.google.cloud.tools :jib-maven-plugin:1. 4.0:dockerBuild 插件时失败