Social Media

Maven, Eclipse and Java 9

Anyone that uses the M2E(maven-to-eclipse) plugin in eclipse knows the issue where you have run a build, then update maven on your project only to have it reset the JRE and throw up a wall of project errors! I noticed the issue in the post I made on running Java EE 8 with Java 9 using Open Liberty

The solution is to ensure the compiler is running the correct version you require, so –

Or –

There is a further point worth noting if you are using Java 9 or later, as the version number format is different. So while Java 8 has a version of 1.8, Java 9 has a version of 9 –


Java 9 vs Java 8 versions

This means you need to state the version in your pom as –

Or using the full version in my JavaEE8 project( this would be stated as –

This will prevent the problem in eclipse

This post may seem obvious – but it is worth stating that the change in version number for Java 9 means you must check you are using the correct version number in maven

About the Author Martin Farrell

My name is Martin Farrell. I have almost 20 years Java experience. I specialize inthe Spring Framework and JEE. I’ve consulted to a range of businesses, and have provide Java and Spring mentoring and training. You can learn more at About or on my consultancy website Glendevon Software

follow me on:

Leave a Comment:

1 comment
Back To Blogging - javabullets says 09/09/2018

[…] Entity Lifecycle Why do we still create Util classes? Back To Blogging Maven, Eclipse and Java 9 Would you use JSF for your next project? Java 9 on Java EE 8 Using Eclipse and […]

Add Your Reply