0

I'm writing a library and in library I'm using selenium.

When I test the code I get the following error:

  Unsupported major.minor version 52.0 (unable to load class
  org.openqa.selenium.WebDriver)

Development System:

openjdk version "1.8.0_131"

OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)

OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

Test System where I get error:

java version "1.8.0_144"

Java(TM) SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

It looks like both system has Java 1.8, so why is there incompatible error in my test ?

Mohsin Awan
  • 1,176
  • 2
  • 12
  • 29
Nebi M Aydin
  • 258
  • 1
  • 3
  • 16
  • Are you *sure* you're running on that Java version? Just because Java 8 is installed, doesn't mean that your code is using that particular Java installation. You can have many Java versions installed. – Andreas Aug 14 '17 at 19:13
  • It's actually java tomcat application. Which previously was using java 1.7 and I updated to 1.8 and when I type java -version these are what I got. – Nebi M Aydin Aug 14 '17 at 19:14
  • So Tomcat is not using that Java version, but some other Java version that is installed on your system. Installing new Java version doesn't necessarily mean that Tomcat will use it, unless you tell it to. – Andreas Aug 14 '17 at 19:15
  • I guess so, how can I check which java it's using? – Nebi M Aydin Aug 14 '17 at 19:16
  • If the Tomcat `manager` app is installed, it will tell you. The `catalina.log` file may also tell you. If you're running Tomcat as a Windows service, you'll need to un-register and re-register that service, since it snapshots which Java installation to use. – Andreas Aug 14 '17 at 19:17

0 Answers0