How to configure the java version? [closed]

3

>

[modelVersion]4.0.0[/modelVersion]
  [groupId]com.algaworks[/groupId]
  [artifactId]comecando-primefaces[/artifactId]
  [version]0.0.1-SNAPSHOT[/version]
  [packaging]war[/packaging]

  [properties]
    [project.buid.sourceEncoding]UTF-8[/project.buid.sourceEncoding]
  [/properties]

  [build]
    [plugins]
        [plugin]
            [artifactId]maven-compiler-plugin[/artifactId]
            [version]3.1[/version]
            [configuration]
                [source]1.8[/source]
                [target]1.8[/target]
            [/configuration]
        [/plugin]
    [/plugins]
  [/build]

[/project]

The configuration of the java version is 1.8. However, the official configuration continues 1.5. I've already used Maven->Update Project->Ok , which in the video worked, but in my eclipse not your right, continued 1.5.

In addition, Eclipse points to an error on line 6 (% with%). Force maven update did not solve the problem, unlike what the teacher said in the video.

How to solve?

    
asked by anonymous 04.08.2015 / 19:51

1 answer

0

The <source>1.8</source> tag is not in the correct location.

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>smochin</groupId>
<artifactId>InstagramAPI</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-client</artifactId>
        <version>9.3.1.v20150714</version>
    </dependency>
</dependencies>

See, it is in properties/source and its configuration is in build/plugins/plugin/configuration/source .

Worth it for target too.

    
04.08.2015 / 20:06