Unable to locate the Javac Compiler

后端 未结 2 726
[愿得一人]
[愿得一人] 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:32

    it seems like your PATH is not picked up correctly... does the output of "echo $PATH" contain the directory where javac resides? I would suggest following:

    open terminal and do an:

    export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03
    export PATH=$PATH:$JAVA_HOME/bin
    javac -version
    which javac
    

    if javac -version still does not work create a symlink in /usr/local/bin pointing to your javac binary:

    cd /usr/local/bin
    ln -s /usr/lib/jvm/jdk1.7.0_03/bin/javac javac
    

    this should get you up an running... an alternative is to try setting up java via your package management system (e.g. "apt-get install java" or sth. similar)

提交回复
热议问题