Automation, Automation Framework, BDD, Behaviour Driven Development, eclipse, Functional Testing, Java, Testing

java.lang.UnsupportedClassVersionError: com/CucumberOptions/RunCukeTest : Unsupported major.minor version 51.0

Hi all, I am trying to run an existing project of cucumber in my existing eclipse and faced an issue. In this piece of write-up I will be sharing the resolution of the Error I got while executing the project.

Tools and specifications

  1. IDE : Eclipse
  2. Programming Language : Java7
  3. Unit testing framework : Junit
  4. Framework used : BDD
  5. Tools used to make this framework : Cucumber
  6. Build tool : Maven

You can run the code from eclipse like this

  • ‘Maven Clean Install’


  • Right-click on your java file and select Run as Junit Test. Using any of these commands you can run your project.

I tried the second option and I got the below error.

java.lang.UnsupportedClassVersionError: com/CucumberOptions/RunCukeTest : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(


Step 1

This is an java version issue. I had java 6 at my  local and  the code has java 7 dependencies in it. So you have to make changes in eclipse IDE and your OS. Follow these steps:

  • Download java 7 at your local Operating system.

You can use this link :

  • Set PATH , JAVA_HOME at your environment variables according to the OS you have.

You can use this link :

Once this is done , now its time to make changes in eclipse, for this you need to do the below steps:

  • Go to Eclipse — > Windows –> Preferences –> Java –> InstalledJRE.
  • Now here Go to Search ,and give the path of the JDK 7 you have installed

This will set the java version of eclipse IDE to Java7.


1. Right click on your project –> Properties –> Java Build Path –>Add Library –> JRE System Library –> Search –> and give the path of the JDK 7 you have installed .

Next you need to make the updates in your project also, for this you need to do these steps:

  • Go to Eclipse — > Windows –> Preferences –> type compiler
  • Now Java –> compiler –>Change the compiler to 1.7 from 1.6(or whichever is set).



Step 2

Go to your project and right-click over it.

Now go to ‘Java BuildPath’ and select ‘JRE System Library’




And click on Edit JRE system, you will land to the below screen. Click on environment and select Java SE 1.7

JRE-7(jre)Now click Finish and Ok.

Refresh the workspace in which you are working and you are done with the fixes.

That’s all you need to do, thanks for reading and happy testing 🙂



2 thoughts on “java.lang.UnsupportedClassVersionError: com/CucumberOptions/RunCukeTest : Unsupported major.minor version 51.0”

  1. I see a lot of interesting articles here, i know
    writing articles requires a lot of time, but i know unlimited source
    of content for your website , just search in google – rewriter creates an unique article in a minute


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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s