TestNG | Troubleshoot unsupported major.minor version error

When you run a TestNG or plain Java script, you may get an error related to "Unsupported major.minor version." This error might occur due to a Java version compliance mismatch. To resolve the issue, try setting the JAVA compiler compliance as follows in the Eclipse IDE:

  1. Go to Windows options > Preferences > Java > Compiler.

  2. From the list, select compiler compliance level 1.7.

  3. Click Apply and OK.

  4. Try rerunning the application. The issue should now be resolved.