5

Running Ubuntu 12.04 amd64 with Oracle JDK 1.7.0_51.

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

When I try to run mvn install on my project, I get this nice 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'm fairly certain that I have a compiler installed, but it doesn't see it.

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

Jon Heller
  • 34,999
  • 6
  • 74
  • 132
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
  • 1
    possible duplicate of [No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?](http://stackoverflow.com/questions/19655184/no-compiler-is-provided-in-this-environment-perhaps-you-are-running-on-a-jre-ra) – dognose Mar 11 '14 at 22:55
  • can you post the content of `ls -l /usr/lib/jvm/java-7-oracle`? I think it is supposed to have `bin/javac` which is a compiler, not just `jre/bin/java`. Since `JAVA_HOME` is `/usr/lib/jvm/java-7-oracle`, it looks for `/usr/lib/jvm/java-7-oracle/bin/javac` for compiler, thats where it is complaining as it didnot find `javac` – prayagupa Jul 09 '17 at 20:49
  • [What is the difference between JDK and JRE?](https://stackoverflow.com/a/1906642/432903) – prayagupa Jul 09 '17 at 20:51

0 Answers0