Manish Gupta
Manish Gupta

Reputation: 31

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.

Upvotes: 2

Views: 5241

Answers (3)

user3760402
user3760402

Reputation: 81

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

enter image description here

Upvotes: 1

Jonathan
Jonathan

Reputation: 5107

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.

Upvotes: 0

AGan
AGan

Reputation: 487

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

Upvotes: 4

Related Questions