You may face an Eclipse IDE warning because project build path specifies an execution environment different to the JRE used by the workspace

Scenario, you have JDK 1.8 but eclipse have JRE 1.5 as default. When you create a Maven project the eclipse will report 2 warnings:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
The compiler compliance specified is 1.5 but a JRE 1.8 is used.
To fix it add this properties to your pom.xml.
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Other possibility, configure the plugin directly.
You may use spring-boot-maven-plugin or maven-compiler-plugin which are equivalent.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
Since version 3.6 maven-compiler-plugin provide a new way using release were you define your source and target in one shot.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>9</release>
</configuration>
</plugin>
One final option you may find out is using just java.version properties. Be warned if you do not provide the maven-jar-plugin version you will get an Unknown error in eclipse. As well you will get the Unknow error if you use a version 3.1.2, so sorry stay on 3.1.1.
java.version is a Spring propertie is not referenced in the Maven documentation, i.e, <java.version> is allowed only if you use Spring Boot.

<properties>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
Finally… An important point to consider is that the source and the target version in the Maven configuration should not be superior to the JDK version referenced by the JAVA_HOME, and of course an older version of the JDK cannot compile with a more recent version since it doesn’t know its specification.