Automation, Functional Testing, Java, Selenium, Selenium Errors

java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1

java.lang.UnsupportedClassVersionError: com/xtr/parallel/QuickTestWinFF :Unsupported major.minor version 51.0 at
 java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(
 at java.lang.ClassLoader.defineClass( at at at$000( at$ at
 Method) at at
 java.lang.ClassLoader.loadClass( at
 sun.misc.Launcher$AppClassLoader.loadClass( at
 java.lang.ClassLoader.loadClass( at
 org.testng.internal.ClassHelper.forName( at
 org.testng.xml.XmlClass.loadClass( at org.testng.xml.XmlClass.init( at
 org.testng.xml.XmlClass.( at
 org.testng.xml.TestNGContentHandler.startElement( at at
 9) at at at$ at at at at at at at$JAXPSAXParser.parse( at
 javax.xml.parsers.SAXParser.parse( at javax.xml.parsers.SAXParser.parse( at
 org.testng.xml.SuiteXmlParser.parse( at
 org.testng.xml.SuiteXmlParser.parse( at org.testng.xml.Parser.parse( at
 org.testng.TestNG.initializeSuitesAndJarFile( at at
 org.testng.remote.RemoteTestNG.initAndRun( at

Steps to resolve the above error

  • Step 1 : Right click on project and select TestNG. And now select .Convert to TestNG ‘ option as shown in figure below.


  • Step 2: Now you have check the below highlighted portions of configurations like location, Suite name, Test name, mode selection, etc. Once this is done, click ‘Finish’.


  • Step 3: Now you have to run the project, for this go to testng.xml  formed in above steps. Right click on it and select ‘Run configuration’.

You will get the below screen , where in you need yo specify the below highlighted areas of configurations. Check the suite name is correct, JRE version of project, whether it is pointing to the correct testng.xml or not, etc.


Once you are done with this, click on ‘Run’ and you are done.

Console output should be:

[TestNG] Running:
Test Suite
Total tests run: 2, Failures: 0, Skips: 0

1 thought on “java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s