3

I created a springboot project from spring initializr then I created a maven project with the same name and I import the project into eclipse.

JDK version is 1.8 and target run time is Apache tomcat 8.0.

but when i try to make run maven install the build doesn't pass by displaying this error

[INFO] Compiling 1 source file to 
C:\Users\scharafi\workspace\ServeursGestionStock\target\classes
[INFO] -------------------------------------------------------------
[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: 8.009 s
[INFO] Finished at: 2018-06-22T18:48:38+01:00
[INFO] Final Memory: 20M/159M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project ServeursGestionStock: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
CHARAFI Saad
  • 1,340
  • 3
  • 16
  • 36
  • 1
    Well, just from looking at the error message that you get I have to ask: are you 100% sure that you are running this on a JDK and not simply on a JRE? What is the value of your JAVA_HOME environment variable? – Serban Petrescu Jun 22 '18 at 18:07
  • @SerbanPetrescu the value of JAVA_HOME is C:\Program Files\Java\jdk1.8.0_60 and the value of M2_HOME is C:\Program Files (x86)\apache-maven-3.5.2 – CHARAFI Saad Jun 22 '18 at 18:12
  • Ok, so it looks like it is a JDK... Are you running this directly in the command line via `mvn install` or are you doing it through an IDE (eclipse in this case I guess)? – Serban Petrescu Jun 22 '18 at 18:34
  • @SerbanPetrescu from the IDE (Eclipse) – CHARAFI Saad Jun 22 '18 at 18:42
  • Ok, then check out this other answer from a similar question: https://stackoverflow.com/a/21099229/7612556 – Serban Petrescu Jun 22 '18 at 18:43

0 Answers0