MVN包安装错误javac:无效的目标版本:1.8

时间:2015-07-27 18:37:43

标签: java git maven pom.xml

我正在尝试安装this from git

(我正在运行Ubuntu。)我收到此错误

[WARNING] The POM for de.jungblut.common:thomasjungblut-common:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ glove ---
[INFO] Deleting /home/nat/workspace/Glove/target
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ glove ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ glove ---
[INFO] Compiling 12 source files to /home/nat/workspace/Glove/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
javac: invalid target release: 1.8
Usage: javac <options> <source files>
use -help for a list of possible options

[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.782s
[INFO] Finished at: Mon Jul 27 14:33:32 EDT 2015
[INFO] Final Memory: 11M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project glove: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] javac: invalid target release: 1.8
[ERROR] Usage: javac <options> <source files>

我有谷歌这个,听起来我的Java可能位于错误的地方? POM文件有问题吗?

1 个答案:

答案 0 :(得分:2)

确实,我需要将JDK更新为JDK 8.这就是我使用的:

  

$ sudo add-apt-repository ppa:webupd8team / java

     

$ sudo apt-get update

     

$ sudo apt-get install oracle-java8-installer

安装完成后,我还需要在sudo

之前添加mvn clean package install

它就像一个魅力。感谢@Jesper