Intermittent java error when running Circle CI with nightwatch/selenium/saucelabs

selenium
nodejs
java

#1

We are intermittently getting this bug when running Circle Ci with nightwatch/selenium/saucelabs

Exception in thread “main” java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncherV3 : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

https://circleci.com/gh/OxfordAbstracts/application/6722

Often the only thing that fixes it is renaming the branch and rebuilding. Any help with resolving this would be greatly appreciated. Thanks


#2

The error is

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

This is the same issue as described here and occurs pretty much every time a new version of webdriver, selenium, or a browser comes out.

You should either manually upgrade the version of these tools so that they match, or pin them so that they are not updated from underneath you.


#3