错误重现

我的机器上安装了 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错误的解决方法的更多相关文章

  1. Eclipse启动时发生An internal error occurred during: "Initializing Java Tooling".错误的解决方法

    问题描述: Eclipse启动时发生An internal error occurred during: "Initializing JavaTooling".错误的解决方法 解决 ...

  2. Jquery中使用setInterval和setTimeout会提示缺少对象的错误,解决方法如下:

    直接在ready中调用其他方法,会提示缺少对象的错误,解决方法如下: 方法1. 应用jQuery的扩展可以解决这个问题. $(document).ready(function(){ $.extend( ...

  3. 启动 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 ...

  4. 启动 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 ...

  5. Win8.1无法安装更新,提示0x800*****错误的解决方法

    Win8.1无法安装更新,提示0x800*****错误的解决方法   注:本教程同样适用于Win10系统 有时候Win8.1某个系统文件的损坏会导致无法安装Windows更新,表现为Windows更新 ...

  6. Linux yum提示Loaded plugins错误的解决方法

    yum是Linux软件包管理器,也叫yum源,在yum使用过程中,有时会出现Loaded plugins错误,重启无效,遇到这种情况该如何解决呢?下面就给大家介绍下Linux yum提示Loaded ...

  7. 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错误 ...

  8. 关于Quartus构建nios软核以及eclipse建立c语言工程以及成功下载到FPGA芯片过程遇到的各种问题以及解决方法详解

    这不是一篇构建nios的教程,而是遇到的各种问题以及解决方法.至于构建教程,网上一大把,我推荐正点原子的FPGA教程,比较新,比较详细,通俗易懂!!! 这里以一个点亮LED灯的Nios软核为例,很明显 ...

  9. nginx提示:500 Internal Server Error错误的解决方法

    现在越来越多的站点开始用 Nginx ,("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 ...

随机推荐

  1. JavaScript函数体系

    第4章  JavaScript函数 1. 函数基本介绍 ① 为什么需要函数 函数最大的好处就是将零散的代码封装到了一起,当我们要再次使用该功能的时候,不需要再重新书写代码,只需要调用封装好的函数就可以 ...

  2. 关于@webFilter使用@Order无效问题

    前言 在SpringBoot系列文章的<第七章:过滤器.监听器.拦截器>中,小技巧中指出,可使用@Order设置过滤器的执行顺序.由于没有自己求证过,看了相关材料后,想当然的写进了文章中, ...

  3. mysql 批量修改 表字段/表/数据库 字符集和排序规则

    今天接到一个任务是需要把数据库的字符编码全部修改一下,写了以下修正用的SQL,修正顺序是   表字段 > 表 > 数据库. 表字段修复: #改变字段数据 SELECT TABLE_SCHE ...

  4. The sixth day

    bound to 铁定You are bound to be fired  你会被铁定开除的 A:Dan forgot his map? Dan忘了带地图了吗? B:Yep!And he's boun ...

  5. html的语法 3

    <html> <head> <title>这是第一节课网页标题</title> <!--meta charset="UTF-8" ...

  6. mail客户端POP和IMAP协议

    POP-邮局协议 mail客户端如果使用POP协议,那么线上服务器的邮件将会自动下载到客户端. IMAP-因特网消息访问协议 mail客户端如果使用IMAP协议,邮件服务器上的邮件将不会自动下载到客户 ...

  7. 使用Loadrunner监控Windows资源

    为了区分把装有loadrunner的机器称作A,被监控资源的服务器(windows)称作B 1.确保B机器Administrator账户是可使用状态:右键计算机→ 管理→ 本地用户和组→ 用户,其中A ...

  8. python字符串及字符串操作

    字符串介绍 1.字符串在内存中的存储: 2.字符串相加: 3.字符串的格式化: In [1]: a = 100 In [2]: a Out[2]: 100 #100<255,在堆内存下占用了一个 ...

  9. Android商城开发系列(十)—— 首页活动广告布局实现

    在上一篇博客当中,我们讲了频道布局的实现,接下来我们讲解一下活动广告布局的实现,效果如下图: 这个是用viewpager去实现的,新建一个act_item.xml,代码如下所示: <?xml v ...

  10. jq动态增加的button标签click回调失效的问题,即动态增加的button标签绑定事件$("button.class").click(function)无效

    对于新增加的页面元素,改变了页面结构,如果是使用老办法$("button.class").click(function)去监听新的button标签事件,会失效. 笔者的应用是文字的 ...