有效解决办法:marven:Fatal error compiling: 无效的目标发行版: 11

简介: 有效解决办法:marven:Fatal error compiling: 无效的目标发行版: 11

具体错误:


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project teavm-tests: Fatal error compiling: 无效的目标发行版: 11 -> [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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :teavm-tests

打开对应的pom.xml,有如下内容:


 

<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <source>${java-tests.version}</source>
            <target>${java-tests.version}</target>
          </configuration>
        </plugin>

把source/target改为1.8是不对的。在pom.xml中应该有类似如下的配置:


 

<java.version>1.8</java.version>
    <java-tests.version>11</java-tests.version>

吾把11改成1.8,就报一些接口找不到。所以,吾解决办法是提高了java.version。

目录
相关文章
|
缓存 数据库
什么是缓存击穿 ? 怎么解决 ?
什么是缓存击穿 ? 怎么解决 ?
933 0
|
XML SQL Java
Maven的三种打包方式(jar、shade、assembly)
Maven的三种打包方式(jar、shade、assembly)
5668 0
|
网络协议 应用服务中间件 nginx
解决 nginx 启动错误host not found in upstream "XXXX.com“
在前置机上利用nginx进行反向代理的时候,我们会配置proxy_pass。在启动nginx的会报如下错误:host not found in upstream "XXXX.com“
5394 0
|
Java Maven
idea中maven项目pom文件Could not acquire lock(s)
idea中maven项目pom文件Could not acquire lock(s)
7592 2
|
缓存 Java
java: 警告: 源发行版 17 需要目标发行版 17,java17 无效的目标发行
java: 警告: 源发行版 17 需要目标发行版 17,java17 无效的目标发行
9124 3
|
XML Java 数据库连接
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
13816 2
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
|
Java 开发工具 C++
(2023版本)GraalVM+native-image+Visual Studio 在Win10上全流程安装,避坑+实操
(2023版本)GraalVM+native-image+Visual Studio 在Win10上全流程安装,避坑+实操
816 1
(2023版本)GraalVM+native-image+Visual Studio 在Win10上全流程安装,避坑+实操
|
Nacos 数据安全/隐私保护 微服务
Seata常见问题之no available service found in cluster如何解决
Seata 是一个开源的分布式事务解决方案,旨在提供高效且简单的事务协调机制,以解决微服务架构下跨服务调用(分布式场景)的一致性问题。以下是Seata常见问题的一个合集
2002 0