Forum Discussion

shawny's avatar
shawny
New Contributor
10 years ago

[Resolved] Issues executing JAR files via testrunner.bat

Hi all,

I am using SoapUI 5.0.0 open sources version, and I am encountering issues in one of my test cases when I am executing a .jar file in the Groovy script. My script looks like this:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def filepath = new File(groovyUtils.projectPath)
def proc = ""java -jar seleniumFirefox.jar".execute(null, filepath)


I encounter issues only when I try running this test case through the %SOAPUI_HOME%/bin/testrunner.bat file on the command line. I've tried running this on two different machines, and I get the same error on both machines:

15:03:29,906 INFO [SoapUITestCaseRunner] running step [SeleniumTest]
15:03:30,722 ERROR [log] runSelenium err:
java.lang.UnsupportedClassVersionError: seleniumFirefox : Unsupported major.minor version 52.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$100(Unknown Source)
at java.net.URLClassLoader$1.run(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 sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Exception in thread "main"

There seems to be a mismatch in Java version - but I'm not sure not to solve this issue. Any suggestions? Thanks!

2 Replies

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi,
    when you run the java command from the groovy script, you got an error saying the java command cannot use classes build for java 8 or greater
    This is what means (see http://en.wikipedia.org/wiki/Java_class ... ral_layout)
    java.lang.UnsupportedClassVersionError: seleniumFirefox : Unsupported major.minor version 52.0


    So seleniumFirefox.jar is intended to be used with a java 8 version and you run it with java 7 (or lower). This is probably the version used to run soapui (i guess you have installed SoapUI with an embedded jre)
    You have 2 solutions:
    * if you have sources seleniumFirefox, compile it to make it work with java 7 (if the code does not rely on java 8 features)
    * install a java 8 jre on your machine, set the JAVA_HOME env var to the java 8 installation directory (see also viewtopic.php?f=5&t=25106) and restart Soapui. In the startup log, you should this the new java version being used

    Hope this will help
  • shawny's avatar
    shawny
    New Contributor
    YOU.....ARE.....SO.....AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Worked like a charm!

    Internet high five!!!