0

Basic configurations:

Docker container for My PHP instance, I installed Centos and inside java, then Selenium but when I try to start it, it gives me an error.

[root@6f0958965698 ~]# cat /etc/redhat-release

CentOS Linux release 7.5.1804 (Core)

[root@6f0958965698 ~]# java -jar /opt/selenium-server-standalone.jar

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncherV3 : Unsupported major.minor version 52.0

[root@6f0958965698 ~]# java -version

java version "1.7.0_191" / OpenJDK Runtime Environment (rhel-2.6.15.4.el7_5-x86_64 u191-b01)/ OpenJDK 64-Bit Server VM (build 24.191-b01, mixed mode)

  1. I tried first with the version http://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.0.jar
  2. and then with: http://selenium-release.storage.googleapis.com/3.2/selenium-server-standalone-3.2.0.jar

Same mistake.

Do you have any suggestions?

1 Answers1

0

Exception in thread main java.lang.UnsupportedClassVersionError is thrown because the jar is compiled with higher version of Java and trying to run with lower version.

Please refer to this answer: How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

Ex: Compiled with JDK 1.8 But you run it JDK 1.7, so this throws the exception.

Just update the java version to JDK 1.8 in your container and run again.

Afzaal Ahmad Zeeshan
  • 15,669
  • 12
  • 55
  • 103
Aditya Karra
  • 151
  • 1
  • 7