Maven Compile Error

后端 未结 8 1961
南笙
南笙 2020-12-15 08:52

When I build and run my program in Netbeans, it works without a problem. But with same pom.xml file when I try \"mvn compile\" I get this error:

[ERROR] Fail         


        
相关标签:
8条回答
  • 2020-12-15 09:58

    It seems your maven java home point to a jre not jdk

    Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
    

    You have to change it to a jdk.

    Try java -version and see what is there

    use /usr/sbin/alternatives --config java to change your java version.

    0 讨论(0)
  • 2020-12-15 09:59

    It seems your maven compiler plugin version is 1.3.

    Have a look at this link to force the compiler to run with JDK 1.7, http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html

    0 讨论(0)
提交回复
热议问题