0

when i am trying to create Spring Boot Project using New Version which is "v 2.1.7"

   <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.7.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

this time its through Following error:

Description Resource Path Location
Type Unknown pom.xml /demo-1 line 1 Maven Configuration Problem

If i am going to replace This new Version to my previous old version in porm.xml file with name space its Working good without any error, and if i deleted .m2 folder and reinstall eclipse then its support to new version but i want to use existing eclipse with New version of Spring Boot, what can i do for it.

it is possible to update existing .m2 folder ?

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.7.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo-1</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo-1</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

when i am trying to install maven this time following error show

[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< com.example:demo-1 >-------------------------
[INFO] Building demo-1 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ demo-1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ demo-1 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\Enternship\SPRING BOOT\demo-1\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: 5.933 s
[INFO] Finished at: 2019-09-02T18:45:56+05:30
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project demo-1: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
AMAR MAGAR
  • 137
  • 2
  • 13
  • Can you post the full `pom.xml` file ? – Benoit Sep 02 '19 at 13:12
  • Also the full error output best from running on plain command line ... – khmarbaise Sep 02 '19 at 13:13
  • In console its show Jdk/jre error , but if i change spring boot version its work good – AMAR MAGAR Sep 02 '19 at 13:19
  • 2
    Is your file really named `porm.xml` or is that a typo in the question? – Mike Sep 02 '19 at 13:21
  • 1
    sorry , its spelling mistake, its actually name is pom.xml – AMAR MAGAR Sep 02 '19 at 13:22
  • Are you running `mvn` from the same directory as the pom file? And do you have the JDK installed (you can run `javac` to confirm)? – Mike Sep 02 '19 at 13:23
  • yes sir , was checked it, its working fine, I think its not issue of jdk, because of if i replace pom.xml file to my old project then its working good – AMAR MAGAR Sep 02 '19 at 13:24
  • What spring boot version are you changing back to that works? – Mike Sep 02 '19 at 13:25
  • Which `mvn` command are you executing, exactly ? The warning "[WARNING] The requested profile "pom.xml" could not be activated because it does not exist." makes me think that you run something like `mvn -P pom.xml` ? – Benoit Sep 02 '19 at 13:26
  • 3
    The error tells you what is wrong `[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project demo-1: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?` You are running the build with a JRE instead of a JDK (the latter does contain `javac` the former doesn't hence the error). – M. Deinum Sep 02 '19 at 13:31
  • I have exactly the same problem. Did you find the reason ? the pom.xml works ok with older verion, and OK also with IntelliJ, but under eclipse i got a "Maven Configuration Problem" – Gauthier Peel Oct 04 '19 at 08:48
  • this is a duplicate : from https://stackoverflow.com/questions/56142369/why-am-i-getting-unknown-error-in-line-1-of-pom-xml and https://stackoverflow.com/questions/56212981/eclipse-showing-maven-configuration-problem-unknown where you have good answers. – Gauthier Peel Oct 04 '19 at 08:54

1 Answers1

0

just configure the JDK path the steps are

  1. right-click on the project
  2. click on properties
  3. type java build path and go to java build path
  4. click on libraries
  5. click on JRE system libraries
  6. edit that
  7. click on alternate JRE
  8. click on Installed JREs
  9. click on Add
  10. select standard VM
  11. click Next
  12. place your JDK path and select that

By this, you will not see the error

=>No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
kushal Baldev
  • 729
  • 1
  • 14
  • 37