3
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

I use Eclipse, Maven and java8-openjdk.

  1. I am using JDK not JRE:

    Build path screenshot.

    Installed JREs -> Execution environment screenshot

    Java is located at **/usr/lib/jvm/java-8-openjdk-amd64/**.

  2. The class with main method compiles and runs without a problem.

  3. I was able to build before without any problems.
  4. The runtime version of Eclipse:

    java.runtime.version=1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14
    
  5. In pom.xml, I have Maven compiler plugin, with version 3.5.1, source and target values 1.8.

What am I missing here ? I have configured correct path. I have JDK. I did builds before and yet Maven is failing now.

Please let me know how to start about finding the root cause and also let me know if any more information is needed. Thanks.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Aravamudhan
  • 198
  • 2
  • 11

1 Answers1

3

Seems like maven-compiler-plugin version 3.x is using tools.jar for compilation rather then javac, please make sure this jar is present under $JAVA_HOME/lib and eclipse has permissions to access it.

You should also verify that tools.jar exists under Windows->Preferences->Installed JREs, and if it is not, add it manually.

Shmulik Klein
  • 3,754
  • 19
  • 34
  • 1
    Thanks for your help. java-8-openjdk-amd64, which I installed does not have tools.jar and dt.jar by default. I will add them and check. – Aravamudhan Jul 02 '16 at 15:25
  • My jdk had the tools.jar installed but they were not added in the "Installed JRE" on eclipse. Its all good after adding those. – Vishal--JAVA--CQ May 31 '19 at 03:29