简体   繁体   中英

Error While running TestNG test

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

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

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

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 ?

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 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

I removed JRE System Library v6 and added current version (v8 in my case) via "Add Library"

在此处输入图片说明

I had a similar problem and deleted all of the 1.6 JREs from my Eclipse preferences. You can still build 1.6 projects under a 1.7/1.8 JRE, so 1.6 probably isn't needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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