0 votes
1 view
in Devops and Agile by (25k 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

ne-2.47.1.jar

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 java.security.SecureClassLoader.defineClass(Unknown Source)

        at java.net.URLClassLoader.defineClass(Unknown Source)

        at java.net.URLClassLoader.access$000(Unknown Source)

        at java.net.URLClassLoader$1.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(Unknown 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.

C:\automation\node_modules\selenium-webdriver>

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 (63.3k 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...