【104】Maven3.5.0结合eclipse使用,提示Lambda expressions are allowed only at source level 1.8 or above错误的解决方法
错误重现
我的机器上安装了 maven 3.5.0,在 eclipse 中创建 maven 项目。pom.xml配置如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>zhangchao</groupId>
<artifactId>testVertx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- 一些依赖 -->
</dependencies>
</project>
在项目上鼠标右键 -> Maven -> Update Project … -> OK 代码中一直给出错误提示,内容如下:Lambda expressions are allowed only at source level 1.8 or above.
解决方法
更改 pom.xml 配置,有两条关键语句:
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
把这两条语句加入 properties 标签对中,更改后的代码如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>zhangchao</groupId>
<artifactId>testVertx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<!-- 一些依赖 -->
</dependencies>
</project>
重新在项目上鼠标右键 -> Maven -> Update Project … -> OK 。
如果Update Project还不管用,就鼠标右键 -> Run as -> Maven build… -> Goals 中输入 clean compile -> RUN
这个时候应该就不会有错误提示了。
【104】Maven3.5.0结合eclipse使用,提示Lambda expressions are allowed only at source level 1.8 or above错误的解决方法的更多相关文章
- Eclipse启动时发生An internal error occurred during: "Initializing Java Tooling".错误的解决方法
问题描述: Eclipse启动时发生An internal error occurred during: "Initializing JavaTooling".错误的解决方法 解决 ...
- Jquery中使用setInterval和setTimeout会提示缺少对象的错误,解决方法如下:
直接在ready中调用其他方法,会提示缺少对象的错误,解决方法如下: 方法1. 应用jQuery的扩展可以解决这个问题. $(document).ready(function(){ $.extend( ...
- 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!&&在eclipse.ini中为eclipse指定jdk启动
参考:http://blog.csdn.net/zyz511919766/article/details/7442633 http://blog.sina.com.cn/s/blog_028f0c1c ...
- 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!
启动 Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误的解决方法 http://blog.csdn.net/z ...
- Win8.1无法安装更新,提示0x800*****错误的解决方法
Win8.1无法安装更新,提示0x800*****错误的解决方法 注:本教程同样适用于Win10系统 有时候Win8.1某个系统文件的损坏会导致无法安装Windows更新,表现为Windows更新 ...
- Linux yum提示Loaded plugins错误的解决方法
yum是Linux软件包管理器,也叫yum源,在yum使用过程中,有时会出现Loaded plugins错误,重启无效,遇到这种情况该如何解决呢?下面就给大家介绍下Linux yum提示Loaded ...
- Hyper-v安装虚拟机,提示the image's hash and certificate are not allowed错误的解决方法
本文迁移自Panda666原博客,原发布时间:2021年3月29日. Hyper-v安装虚拟机,提示the image's hash and certificate are not allowed错误 ...
- 关于Quartus构建nios软核以及eclipse建立c语言工程以及成功下载到FPGA芯片过程遇到的各种问题以及解决方法详解
这不是一篇构建nios的教程,而是遇到的各种问题以及解决方法.至于构建教程,网上一大把,我推荐正点原子的FPGA教程,比较新,比较详细,通俗易懂!!! 这里以一个点亮LED灯的Nios软核为例,很明显 ...
- nginx提示:500 Internal Server Error错误的解决方法
现在越来越多的站点开始用 Nginx ,("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 ...
随机推荐
- sql 时间函数用法
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...
- RabbitMQ使用教程(四)如何通过持久化保证消息99.99%不丢失?
1. 前情回顾 RabbitMQ使用教程(一)RabbitMQ环境安装配置及Hello World示例 RabbitMQ使用教程(二)RabbitMQ用户管理,角色管理及权限设置 RabbitMQ使用 ...
- 你一直在用的 Spring Boot Starters 究竟是怎么回事
Spring Boot 对比 Spring MVC 最大的优点就是使用简单,约定大于配置.不会像之前用 Spring MVC 的时候,时不时被 xml 配置文件搞的晕头转向,冷不防还因为 xml 配置 ...
- linux下使用shell脚本批处理命令
1.新建脚本touch first.sh 2.写入命令vi first.sh #!/bin/bash #publish service and api echo "copy file&quo ...
- java 从List<Integer> 中随机获取6个数
List<Integer> list 为不重复的数字集合,例如:1,2,3,4,5,6,7,8,9,10 从中随机获取不重复的6个数.代码如下. List<Integer> l ...
- spring构造注入
Sping 结构体系结构4个核心组件 Beans:Bean是包装我们应用程序自定义对象Object的bject存有数据. Core: context在发现建立,维护Bean之间关系所需的一些工具.如资 ...
- Unity3d 游戏中集成Firebase 统计和Admob广告最新中文教程
之前写过俩相关的教程,最近发现插件官方更新了不少内容,所以也更新一篇Firebase Admob Unity3d插件的教程,希望能帮到大家. Firebase Admob Unity3d插件是一个Un ...
- AngularJS 整理学习
参考博客: https://blog.csdn.net/weixin_33178524/article/details/79179597 https://blog.csdn.net/qq_42128 ...
- C#访问修改符
修饰符可以指定访问的可见性,还可以指定其本质.(文章摘自<C#高级编程(第9版)>以及Microsoft) 1. 可见性修饰符 public:应用于所有类型或成员,即任何代码均可以访问该项 ...
- windows mysql忘记密码解决方案
因为mysql很久之前装的,今天突然想用的时候发现密码不记得,怎一个尴尬了得,所以没办法,只能修改一个新的密码. 在此过程中遇到了几个问题 1.没法进入数据库: 2.修 ...