mvn compile - [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

19,377

Solution 1

Set JDK instead of JRE as environment (download it if necessary)

JDK=JRE+Codingstuff (including a compiler)

Solution 2

you need to update environment variable( give JDK path in ENV variable ) here link how to set up

Share:
19,377
Snowcrash
Author by

Snowcrash

Updated on July 09, 2022

Comments

  • Snowcrash
    Snowcrash almost 2 years

    I am running mvn compile from the command line and am getting this:

    [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: 04:12 min
    [INFO] Finished at: 2017-02-24T10:19:32+00:00
    [INFO] Final Memory: 24M/247M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project spring-boot-sam
    ple-atmosphere: Compilation failure
    [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    

    I've seen this answer but it's for Eclipse.

    Any suggestions