Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.7k points)

I am trying to run selenium-standalone-server 2.47.1.jar through the command prompt. But I am facing this error.

C:\automation\node_modules\selenium-webdriver>java -jar selenium-server-standalo


Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/gr

id/selenium/GridLauncher : Unsupported major.minor version 51.0

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(Unknown Source)

        at Source)

        at Source)

        at$000(Unknown Source)

        at$ Source)

        at Method)

        at Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Could not find the main class: org.openqa.grid.selenium.GridLauncher. Program will exit.


Why am I getting this error?

I have JDK installed already(since I need to run Netbeans).

Is there anything I am missing?

1 Answer

0 votes
by (62.9k points)

java.lang.UnsupportedClassVersionError occurs because the code was compiled with a higher version of Java than the one you're running it on.

Version 51.0 of a class file corresponds to java 7

J2SE 8 = 52, J2SE 7 = 51, J2SE 6.0 = 50, J2SE 5.0 = 49, JDK 1.4 = 48, JDK 1.3 = 47, JDK 1.2 = 46, JDK 1.1 = 45

You required to upgrade your JDK from Java 6 to Java 7 or higher.

Browse Categories