Compiling the Maven project with different JDK versions? 

By | November 1, 2020

In this post, We will learn about Compiling the Maven project with different JDK versions? 

Usually, by default, maven 2 supports JDK 1.4, and maven 3 uses JDK 1.5 to compile the project. Which is really too old.  Maven comes with a Compiler Plugin, This compiler plugin helps maven to compile the project source code with a particular JDK version.

Solution

We may configure the plugin compiler directly in pom.xml (Tested with Maven 2 and 3)

pom.xml

Alternatively, We can configure the java version via the property values. (Tested with Maven 3)

pom.xml

That’s all about Compiling the Maven project with different JDK versions? 
If you have any feedback or suggestion please feel free to drop in below comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *