Search code examples
mavenappiumjbehave

Io/appium/java_client/MobileElement : Unsupported major.minor version 51.0


Not sure if it related to Appium , but I'll try....

I have appium test wich is wrapped by jbehave , which is being executed by maven. if I'm executing the test by "mvn clean install" -- works fine... if I put the execution to some script file and running it -- works fine...

The problem starts when I've tried to execute the script by using launchd (MAC task scheduler) I'm getting the next error :

INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.941 s
[INFO] Finished at: 2015-03-12T18:21:59+02:00
[INFO] Final Memory: 19M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (run-stories) on project AppiumClient: Failed to run stories as embeddables: Failure in running embeddable: appium.client.tets_runeners.FirstScenario: io/appium/java_client/MobileElement : Unsupported major.minor version 51.0 -> [Help 1]

As I said , everything works fine by pieces , but the entire flow fails ...

Any idea ? Thanks


Solution

  • This type of error is usually related to not having JAVA_HOME set correctly. When you run from the command line with maven, it seems you have the JAVA_HOME env variable set, while when you do it using launchd you don't.

    Check that your /etc/launchd.conf has the line that would correctly set the JAVA_HOME:

    setenv JAVA_HOME /your/path/to/java/home
    

    This article has a bit more info on how to do that: http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-slash-etc-slash-launchd-dot-conf/