SignalK / signalk-java

Installer and web-app for the artemis-server (a java based Signal K master server)
Apache License 2.0
6 stars 6 forks source link

Maven install faill with unsupported major minor version 52 #7

Closed manuprendlair closed 5 years ago

manuprendlair commented 7 years ago

The Return!

I use these instructions : https://github.com/signalk/specification/wiki/Raspberry-Pi-Installation-(Java-Server)

look the output:


pi@raspberrypi:~/signalk-java $ mvn exec:java
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for nz.co.fortytwo.signalk:signalk-java:pom:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 59, column 13
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Signalk Java 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ signalk-java ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ signalk-java ---
[INFO] Installing /home/pi/signalk-java/pom.xml to /home/pi/.m2/repository/nz/co/fortytwo/signalk/signalk-java/0.0.1-SNAPSHOT/signalk-                                              java-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ signalk-java ---
[WARNING]
java.lang.UnsupportedClassVersionError: nz/co/fortytwo/signalk/server/SignalKServer : 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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281)
        at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:02 min
[INFO] Finished at: 2017-02-06T13:44:52+01:00
[INFO] Final Memory: 14M/35M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project signalk-java: An exception occu                                              red while executing the Java class. nz/co/fortytwo/signalk/server/SignalKServer : Unsupported major.minor version 52.0 -> [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/MojoExecutionException

but:

pi@raspberrypi:~/signalk-java $ java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

So what's wrong, 'cause it look like I have the right SDK version...?

manuprendlair commented 7 years ago

Humm...

pi@raspberrypi:~/signalk-java $ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /opt/apache-maven-3.3.9
Java version: 1.7.0_111, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-armhf/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "4.4.38-v7+", arch: "arm", family: "unix"

So maven setting is wrong somewhere...
manuprendlair commented 7 years ago

well, it look like that it's need to set the JAVA_HOME path in .bashrc file... Like that:

export JAVA_HOME="/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt"
export PATH=$PATH:$JAVA_HOME/bin

I don't understand why it's necessary while sudo update-alternatives --config java is correctly set and java -version confirm the nice version... what specialist thinks about that?