4

I am using Eclipse as IDE. When I right click on the project, then click "Maven Update", my Java version changes to 1.5. Here is what I did so far:

  1. I changed "Java build path" to "workspace default jre 1.8.0_25"
  2. Then changed "java compiler" to 1.8
  3. Then changed "project facets">java>1.8
  4. Lastly Changed pom.xml java version to 1.8
<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.1.3.v20140225</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugin</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

How can I keep it to 1.8 version?

2

1 Answer 1

6

There's a typo in the groupId of the maven-compiler-plugin in your pom.xml file: it should be org.apache.maven.plugins.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.2</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

Note that the groupId actually defaults to org.apache.maven.plugins so you could also omit it.

By default, the JRE used by m2e is 1.5, see this question : Eclipse JRE System Library [J2SE-1.5]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.