Maven can't find JDK

Running Ubuntu 12.04 amd64 using Oracle JDK 1.7.0_51.

$ which javac
/usr/bin/javac
$ which java
/usr/bin/java

When I try to run mvn installin my project, I get this little error:

[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

I am sure that I have a compiler installed, but it does not see this.

JAVA_HOMEset value /usr/lib/jvm/java-7-oracle. Do I need to set another variable for the JDK?

+4
source share

Source: https://habr.com/ru/post/1531253/


All Articles