我尝试运行mvn install
,但是收到了这个消息:
Compilation failure
Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
好的,有一个开源的JDK,我也下载了另一个。我尝试将JAVA_HOME指向这两个JDK,现在已经设置好了:
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
我还尝试了使用sudo update-alternatives --config java
来选择其中一个,但是在其中的不同jdk版本中都得到了相同的错误。
我该如何修复这个问题?谢谢提前。