javatestngunsupported-class-version

Exception in thread "main" java.lang.UnsupportedClassVersionError: RemoteTestNG has been compiled by Java Runtime version 55.0,


enter image description here

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/testng/remote/RemoteTestNG has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0


Solution

  • You're trying to run the tests with Java 8 (class version 52), but the TestNG jar you're using was built with Java 11 (class version 55). Replace your runtime with Java 11 or newer, and you should be fine.