Last Updated: February 25, 2016
· helmedeiros

Maven - Unsupported major.minor version of surefire

Yesterday, I tried to set one of my maven Java projects to be deployed by travis-ci using JDK-7 and I faced issues in surefire plugin:

Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(
at java.lang.ClassLoader.defineClass(

Surefire plugin seems to use by default the default JDK used to run the build for compiling test cases. In my case it was JDK-6. To make it run on new JDK, I made following changes inside my pom.xml