O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specifying the Java version for the Compiler plugin

When we created a new project in Eclipse, you would have observed the following warning:

Specifying the Java version for the Compiler plugin

Why does this error occur? This is because the Maven Compiler plugin, by default, considers the source and target Java version to be 1.5 (for backward compatibility reasons).

Let us resolve this warning.

How to do it...

Let us assume you have configured Java 8 as the default Java runtime in Eclipse, and perform the following steps:

  1. Open the Eclipse project.
  2. Add the following configuration to the Maven Compiler plugin:
     <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required