3

When I am compiling my Maven Project, it shows the below error (in image). Instead of the JRE, I Have mapped the JDK for compilation.

Any suggestion regarding how to fix this would be great 1

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
  • Where does JAVA_HOME point to? – Thomas Aug 19 '15 at 15:50
  • 4
    Please take the [tour], have a look around, and read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) When asking about errors, post the error **as text** so that it's searchable, and so that you can post it even though your rep doesn't let you post images yet. Always include all the debugging you've already done. (If you haven't done any yet, don't post the question. Go do some debugging first, *then* post.) – T.J. Crowder Aug 19 '15 at 15:52
  • 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) – Paul Roub Aug 19 '15 at 16:44

2 Answers2

3

Make sure you JAVA_HOME (in Windows) variable points to installation of JDK, also make sure that version of JDK matches the one specified in pom.xml

Lucas
  • 3,181
  • 4
  • 26
  • 45
1

Main reason would be the JAVA_HOME setup in the environment variable should be pointing to correct JDK location.

  1. Check System -> Advance System Settings
  2. Click on Environment variable
  3. Add variable JAVA_HOME -> "C:\Program Files\Java\jdk1.8.0_141;"
  4. Edit "path" -> append %JAVA_HOME%; to the existing text.
Barani r
  • 2,119
  • 1
  • 25
  • 24