Unable to locate the Javac Compiler

后端 未结 2 711
[愿得一人]
[愿得一人] 2020-12-31 06:05

I tried to mvn install and got this message:

Compilation failure
Unable to locate the Javac Compiler in:
  /usr/lib/jvm/java-7-openjdk-amd64/jre         


        
2条回答
  •  攒了一身酷
    2020-12-31 06:52

    I faced similar error on an ubuntu machine while running a maven build from Jenkins. If output of 'javac -version' prompts below messages:

    "The program 'javac' can be found in the following packages: default-jdk ecj gcj-5-jdk openjdk-8-jdk-headless gcj-4.8-jdk gcj-4.9-jdk openjdk-9-jdk-headless Try: apt install "

    Then you can install "openjdk-8-jdk-headless" using:

    apt install openjdk-8-jdk-headless

    This solved my problem and the maven build went through ok.

提交回复
热议问题