fileversion 55.0 this version of the Java Runtime only recognizes class file versions up to 52.0:已解决

问题描述

运行时会报错:java:无法访i问org.testng.annotations.AfterTest
错误的类文件:/D:/repository/org/testng/testng/7.6.l/testng-7.6.1.jarI/org/testng/annotations/AfterTest.class
类文件具有错误的版本55.0,应为52,0请删除该文件或确保该文件位于正确的类路径子目录中,如下图所示。

在这里插入图片描述

即便是运行通过,在向执行过程中依然会报错:

orgtestngTestNG has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

解决方法

我们在idea下找到setting,如下图所示。

在这里插入图片描述
进入新界面后,我们找到Build Exceution,Deployment,找到Compiler下的Java Compiler,确保使用的jdk版本与Project bytecode versiore中填写的版本一致,如果使用的是2020以上的idea,Project bytecode versiore中1.8也可以写成8,如下图所示。

在这里插入图片描述
再找到设置下的Project Structure,如下图所示

在这里插入图片描述
确保这里的版本也使用一致,如下图所示。

在这里插入图片描述
我们在回到代码界面,按下Ctrl+N,打开搜索框,点击ALL,在全部中搜索Run/Debug Configurations,如下图所示。

在这里插入图片描述
我们选择第一项Edit Configurations进入其中,确保这里的JRE版本也一致,如下图所示。

在这里插入图片描述
还需要注意的有:在poml等等的.xml文件中对jdk的描述,写1.8或者是11,即target=“1.8”,此处不可写8

文章参考

http://t.csdn.cn/2ysk2


以上就是本文全部内容,如果它对您有帮助,请您帮我点个赞,这对我真的很重要

  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Discover the Ideal Investment Strategy for Yourself and Your Clients "To enhance investment results and boost creativity, Jim Ware replaces the maxim know your investments with know yourself. And he gives us specific testing tools to do the job."-Dean LeBaron, Founder, Batterymarch Financial Management, Chairman, Virtualquest.company, and investment author and commentator "Many investment firms fail, even though they are run by intelligent, qualified professionals, because they lack creativity. This book can rescue you. Jim Ware explains how to organize your business to encourage creative thinking. In five years, your customers will be working with an advisor who read this book, so make sure you are the one who did."-Ralph Wanger, President, Acorn Investment Trust, CFA and author of A Zebra in Lion Country: Ralph Wanger's Guide to Investment Survival "Jim Ware has a great knack for understanding people and successful investing. This unusual combination of skills creates a rare find: useful insights to improve investment performance through helping people work together better. Jim's wit and humor make this a fun read as well!" -Dee Even, Senior Investment Officer, Allstate Insurance Company, Property & Casualty "The Psychology of Money represents a major step toward development of a portfolio theory that recognizes human dynamics and differences among people. Jim's content is solid, and his presentation is engaging. This book ought to be on every practitioner's bookshelf."-Kenneth O. Doyle, University of Minnesota, Author, The Social Meanings of Money and Property: In Search of a Talisman "Finally, an insightful look at the human side of investing. A step-by-step guide to enhancing management performance to increase returns."- Abbie Smith, PhD, Professor of Accounting.University of Chicago Business School

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值