cisco-ie / anx

Advanced NETCONF Explorer: Graphical Explorer for NETCONF / YANG and GNMI/GRPC Telemetry & Java NETCONF 1.1 client library
Apache License 2.0
183 stars 43 forks source link

Build explorer error! #24

Closed myonlystarWang closed 4 years ago

myonlystarWang commented 4 years ago

Hi all, I am new to anx and I tried to get a start. When I executed the command line mvn -e -f explorer/pom.xml jetty:run,there war an error:

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/user/anx-master/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainView.java:[37,49] cannot access org.opendaylight.yangtools.yang.model.api.Module
  bad class file: /root/.m2/repository/org/opendaylight/yangtools/yang-model-api/4.0.7/yang-model-api-4.0.7.jar(org/opendaylight/yangtools/yang/model/api/Module.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.308 s
[INFO] Finished at: 2020-05-29T15:59:07Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project explorer: Compilation failure
[ERROR] /home/user/anx-master/explorer/src/main/java/com/cisco/stbarth/netconf/anx/MainView.java:[37,49] cannot access org.opendaylight.yangtools.yang.model.api.Module
[ERROR]   bad class file: /root/.m2/repository/org/opendaylight/yangtools/yang-model-api/4.0.7/yang-model-api-4.0.7.jar(org/opendaylight/yangtools/yang/model/api/Module.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
[ERROR]
[ERROR] -> [Help 1]

the maven version is :

root@user:/home/user/anx-master# mvn -v
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_252, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-101-generic", arch: "amd64", family: "unix"

So I find some help,may anyone could tell me what step I missed or made wrong?thanks for it!

BR myonlystarWang

sbyx commented 4 years ago

I would suggest to give a try with Java 11.

myonlystarWang commented 4 years ago

Hi sbyx, thanks for quickly reply! I will try what you suggested but the error infohinted should be 52.0,52.0=jdk 1.8,why try java 11? I'm a little confused,maybe you can save me :-)

sbyx commented 4 years ago

Your local jdk probably expected it to be 52 but whoever compiled the opendaylight dependency probably used a later version. So easiest solution would be to use a newer version of Java.

myonlystarWang commented 4 years ago

okay,I got it,I will try and back to the response.

myonlystarWang commented 4 years ago

Hi @sbyx,

I followed your suggestion and it worked fine! I will close this issue right now. Thanks very much for your help!

BR, myonlystarWang