首页 > 其他分享 >IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符

IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符

时间:2023-09-25 12:32:00浏览次数:46  
标签:maven diamond IntelliJ KafkaConsumer Idea 运算符 source 报错


最近在使用IntelliJ Idea遇到了挫折,分享出来给大家,问题由来是我导入了外部的java文件,结果就报错了

IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符_解决方法

错误的句子也提示出来了:

KafkaConsumer<String, String> kafkaConsumer = new KafkaConsumer<>(props);



网上搜了各种解决方法都不行,崩溃的节奏啊,终于皇天不负有心人,让我同事解决了,希望对大家也有所帮助吧,原来IntelliJ Idea 默认的jdk是1.5。所以试了各种修改都没起作用。我们必须这样修改

IntelliJ Idea编译报错:请使用 -source 7 或更高版本以启用 diamond 运算符_解决方法_02

选择7.0以上的版本即可,唉,浪费了半天时间

虽然很多博友的文章也没有帮我解决问题,但也是给我的一个启发,我列出了:

https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html


标签:maven,diamond,IntelliJ,KafkaConsumer,Idea,运算符,source,报错
From: https://blog.51cto.com/u_6947107/7594660

相关文章

  • OGG报错 INS-85054 in oggca.sh createing a new Service Manager after removing a p
    这个报错主要是ogg的自启动和目录问题DeletethefollowingfilesattheOSlevel:Linux7/etc/systemd/system/OracleGoldenGate.service/etc/oggInst.locLinux6/etc/init.d/OracleGoldenGate/etc/rc.d/*OracleGoldenGate/etc/rc*.d/*OracleGoldenGate/etc/oggInst......
  • ES报错:[parent] Data too large, data for [<http_request>] would be larger than limi
    ES报错:[parent]Datatoolarge,datafor[<http_request>]wouldbelargerthanlimitofXXXX  当es这个错误的时候:[parent]Datatoolarge,datafor[<http_request>]wouldbelargerthanlimitof[23941899878/22.2gb],with{bytes_wanted=23941987633bytes_l......
  • Logstash报错: Could not index event to Elasticsearch
    Logstash报错:CouldnotindexeventtoElasticsearch 一、环境说明Logstash7.3ElasticSearch7.3二、现象logstash/logs/logstash-plain.log大量警告:ValidationFailed:1:thisactionwouldadd[1]totalshards,butthisclustercurrentlyhas[1000]/[1000]maximum......
  • python教程:解决报错:ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIRE
    从以下两种途径来解决。清除缓存这个错误通常表示安装的软件包与要求文件中的哈希值不匹配。这可能是由于要求文件被更改或软件包被篡改引起的。为了解决这个问题,你可以尝试以下几个步骤:清理缓存:运行以下命令清理pip缓存:pipcachepurge```更新要求文件:如果你更新了软件包的版本......
  • Java语法学习——运算符
    一、基本的算术运算符、+符号做连接符1.基本的算术运算符   为了掌握基本的算术运算符的使用,我们在IDEA里新建一个package(it.com.operator),然后在这下面新建一个Javaclass(OperatorDemo1):packageit.com.operator;publicclassOperatorDemo1{publicstaticvoid......
  • IntelliJ IDEA中执行@Test单元测试时报错Class not found: "..."终极办法
    之前也出现过在编译时找不到测试类的问题,但之前的那篇博文,并不是终极办法IntelliJIDEA中执行@Test单元测试时报错Classnotfound:"..."Emptytestsuite 问题:出现类似问题,普遍时同然就报错了,原因是使用IDEA,从别人的Git上拉取代码后,别人把一些idea的配置文件也传上了,到时更新......
  • PbootCMS附件上传报错UNKNOW: Code: 8192; Desc: stripos()
    PbootCMS附件上传报错UNKNOW:Code:8192;Desc:stripos(),具体显示如下图所示:解决方法:打开/core/function/file.php,找到以下代码:1if (stripos($types,$ext)!== false)改为如下代码:1if (stripos($types,chr($ext))!== false)......
  • 在操作过程中遇到Attempting to operate on hdfs namenode as root报错
    在操作过程中遇到Attemptingtooperateonhdfsnamenodeasroot报错HDFS格式化后启动dfs出现以下错误:[root@hadoop101sbin]#start-dfs.shStartingnamenodeson[hadoop101]ERROR:AttemptingtooperateonhdfsnamenodeasrootERROR:butthereisnoHDFS_NAMENO......
  • [已解决]报错: Error response from daemon: conflict
    报错内容:Errorresponsefromdaemon:conflict:unabletodeletef5b6ef70d79b(mustbeforced)-imageisbeingusedbystoppedcontainer0a740a8a885c解决办法:先删除容器,再删除镜像删除所有已停止的容器dockerrm$(dockerps-a-q)删除所有镜像dockerrmi$(do......
  • git commit 报错:找不到 python 3.8
    到这个问题的原因可能有很多,这里只是记录下针对我遇到这这跟题的原因及解决方法问题描述执行gitcommit命令,报错/usr/bin/env:‘python3.8’:Nosuchfileordirectory问题分析gitcommit命令本身不需要python,找不到python多半配置了hook去进行提交去的检查,例......