[Solved-4 Solutions] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK



Error Description:

    • When we compile a project in Eclipse using m2eclipse and when we set the JDK path in Eclipse like this:

    Windows-->preferences-->installed jres--> jdk1.7.xx path

    • It is showing an 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.424s
    [INFO] Finished at: Tue Oct 29 15:21:01 IST 2013
    [INFO] Final Memory: 5M/15M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-   plugin:3.1:compile (default-compile) on project TEST-WEB: Compilation failure
    [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    
    click below button to copy the code. By - Java tutorial - team

    Solution 1:

      • On your Eclipse IDE, go into Window > Preferences > Java > Installed JREs > and check your installed JREs. You should have an entry with a JDK there.
      • Select the Execution Env as show below. Click OK
      • Then Right-Click on your Project -> Maven -> Update Project

      Solution 2:

        • Set JAVA_HOME to JDK root - required if you run command line or maven(google for this variable)
        • In project properties in section Java Compiller select required JDK - if you run directly from eclipse

        Solution 3:

          • Go into Run -> Run Configurations , select the Maven Build you are running (from the left panel). Then, click the JRE tab and select the option Workspace default JRE.

          Solution 4:

            • Open the project-specific libraries of the Java Build Path: Right-click "Project > Build Path > Configure Build Path..." and select "Libraries" tab.
              • Select the "JRE System Library" entry and hit "Remove".
              • Hit "Add Library...".
              • A wizard pops up. Select "JRE System Library" and hit "Next >".
              • Now select the correct JDK (in my case "Workspace default JRE", which I configured using a JDK).
              • Close wizard by hitting "Finish".
              • Close "Properties" dialog by hitting "OK".

            Related Searches to No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK