Maven error :Perhaps you are running on a JRE rather than a JDK?

后端 未结 20 2327
小鲜肉
小鲜肉 2020-11-30 21:32

I\'ve never worked with Maven before and I am following the instructions here. When I run the command

mvn integration-test -Pamp-to-war

It

20条回答
  •  庸人自扰
    2020-11-30 22:00

    I've been facing the same issue with java 8 (ubuntu 16.04), trying to compile using mvn command line.

    I verified my $JAVA_HOME, java -version and mvn -version. Everything seems to be okay pointing to /usr/lib/jvm/java-8-openjdk-amd64.

    It appears that java-8-openjdk-amd64 is not completly installed by default and only contains the JRE (despite its name "jdk").

    Re-installing the JDK did the trick.

    sudo apt-get install openjdk-8-jdk
    

    Then some new files and new folders are added to /usr/lib/jvm/java-8-openjdk-amd64 and mvn is able to compile again.

提交回复
热议问题