Unsupported Major/Minor Version issue while executing Selenium Scripts / Java Programs using Eclipse IDE

Purpose: When ever we are executing Selenium Scripts / Java Program which is developed / written in some othere version than our version we will get the error "Java.lang.UnsupportedClassVersionError: .............................Unsupported major.minor version"


If you are executing the program using Console / Command Prompt, using additional parameter -source <version number>

For example, if your file name is VersionError.java and executing through Command Prompt use the following command to execute successfully:

javac -source 1.4 VersionError.java

The program will compile successfully.

If you are executing the code using Eclipse IDE follow the steps mentioned below:

Step 1: Click on 'Project' menu option and select 'Properties' submenu.


Step 2: Click on Project Facts from RNP and Select Java in RNP


Step 3: Select required version of Java and click on OK.