我正在尝试在 Linux 12.04 中使用 maven 编译一个程序。为此,我使用了该mvn clean install
命令。但是我收到构建错误:
[ERROR] Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-6-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.
我检查了路径,确实缺少了那个关键文件。这是我所得到的:
user@modelX:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib$ ls
accessibility.properties im net.properties
amd64 images psfontj2d.properties
calendars.properties jar.binfmt psfont.properties.ja
charsets.jar javazic.jar resources.jar
classlist jce.jar rhino.jar
cmm jexec rt.jar
compilefontconfig.jar jsse.jar security
content-types.properties jvm.hprof.txt sound.properties
currency.data logging.properties swing.properties
ext management tz.properties
flavormap.properties management-agent.jar zi
fontconfig.properties meta-index
显然,我正在运行 openJDK,但缺少文件。我该如何解决这个问题?
答案1
显然我缺少了一些重要的软件包。我在这个网站上找到了解决方案: