使用Oracle JDK 1.7.0_51运行Ubuntu 12.04 amd64。
$ which javac
/usr/bin/javac
$ which java
/usr/bin/java
当我尝试在我的项目上运行mvn install
时,我得到了一个很好的小错误:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.579s
[INFO] Finished at: Tue Mar 11 13:48:06 PDT 2014
[INFO] Final Memory: 18M/605M
我相当确定我安装了编译器,但它没有看到它。
JAVA_HOME
设置为/usr/lib/jvm/java-7-oracle
。我是否需要为JDK设置另一个变量?