运行TestNG测试时出错 [英] Error While running TestNG test

查看:293
本文介绍了运行TestNG测试时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了TestNG 6.9.9 Eclipse插件。
我的项目java编译器设置设置为8.0.65。

I have installed the TestNG 6.9.9 Eclipse plugin. My project java compiler setting is set to 8.0.65.

如果我用TestNG执行测试我遇到以下错误:

If I execute an Test with TestNG i got following error:


VM版本1.6.0无效,运行TestNG需要Java 1.7或更高版本。

"VM version 1.6.0 is invalid, Java 1.7 or above is required for running TestNG."

我可以在执行测试的运行配置中更改JRE但是它仍然坚持1.6如何更改此设置?

I can change the JRE in the "Run Configurations" for the executed test but it is stuck with 1.6 How do I change this ?

系统上安装了Java 8.0版本,但看起来插件使用了我项目中的JRE配置。

A Java 8.0 Version is installed on the system, but it looks like, that the plugin use the JRE configuration from my project.

推荐答案

TestNG通常采用Project Execution环境JRE。如果您已将JRE从1.6.x更改为1.7或1.8,那么它应该可以正常工作。只是为了确保步骤,
1)打开测试文件
2)转到运行配置
3)打开JRE选项卡
4)单击Alternate JRE并选择JDK / JRE> 1.6

TestNG usually takes the Project Execution environment JRE. If you've changed the JRE from 1.6.x to 1.7 or 1.8 then it should work. Just to make sure the steps, 1) Open the Test file 2) Go to Run configurations 3) open JRE tab 4) click on Alternate JRE and select JDK/JRE > 1.6

这篇关于运行TestNG测试时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆