I get the following error when I try to start the server:
`pi@raspberrypi:~/habridge $ java -jar ha-bridge-1.4.3.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/bwssystems/HABridge/HABridge : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
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)
`
which I believe is telling me I have a Java version mismatch... I am running the latest version of raspbian-jessie, with java version "1.7.0_95". (I don't know why it says version 1.7x, when it says i have the latest version of Oracle-Java8-jdk installed)
Any suggestions?
I've also tried mvn install, but I get the following error:
'pi@raspberrypi:~/habridge $ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.520s
[INFO] Finished at: Mon Apr 11 20:16:29 EDT 2016
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/pi/habridge). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
pi@raspberrypi:~/habridge $
'
I feel like I'm missing something...
I ran into this too. Fixed it by upgrading from Java 7 that I had installed to Java 8:
sudo apt-get install oracle-java8-jdk
Yeah, that is what is so strange. This is what I get when I run sudo apt-get install oracle-java8-jdk:
'pi@raspberrypi:~ $ sudo apt-get install oracle-java8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
oracle-java8-jdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
pi@raspberrypi:~ $ java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1~deb8u1+rpi1)
OpenJDK Zero VM (build 24.95-b01, mixed mode)'
I'm going to post this issue on the raspberry pi forum and see what they say.
Since you now have 2 jdk's installed you will need to execute sudo update-alternatives to select the version you want to run by default.
And yes, the ha-bridge requires JDK 8, I'll make sure that stands out in the readme.
Excellent this worked, thank you. For anyone searching for the same issue, the code I used to select the version to run by default was:
'sudo update-alternatives --config java'
Thanks again.
Most helpful comment
I ran into this too. Fixed it by upgrading from Java 7 that I had installed to Java 8:
sudo apt-get install oracle-java8-jdk