简体   繁体   English

获取org / testng / TestNG:Maven测试上不受支持的major.minor 52.0版

[英]Getting org/testng/TestNG : Unsupported major.minor version 52.0 on maven test

I have maven-testNG project.Below is my testNG dependency in pom.xml. 我有maven-testNG项目,下面是pom.xml中的testNG依赖项。 JAVA_HOME is C:\\Program Files (x86)\\Java\\jdk1.7.0_67 also set eclipse compiler compilance level as 1.7 JAVA_HOME是C:\\Program Files (x86)\\Java\\jdk1.7.0_67还将eclipse编译器的编译级别设置为1.7

<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.5</version>
    <scope>test</scope>
</dependency>

when I right click project->Run As->Maven Test , then I get above version error. 当我右键单击project-> Run As-> Maven Test时,出现上述版本错误。 When I run individual test as TestNg Test, then test executes successfully . 当我将个别测试作为TestNg Test运行时,测试将成功执行。 Where could be the problem 问题可能出在哪里

52的主要版本指向Java8,请参阅https://en.wikipedia.org/wiki/Java_class_file ,因此您需要升级JDK。

Try mvn -version to find out which Java is used by Maven. 尝试使用mvn -version找出Maven使用的Java。 You may have to define the right Java-Version in your pom.xml too. 您可能还必须在pom.xml中定义正确的Java版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM