I imported a Maven project and it used Java 1.5 even though I have 1.6 configured as my Eclipse default Preferences->Java->Installed JREs.
When I
In case anyone's wondering why Eclipse still puts a J2SE-1.5 library on the Java Build Path in a Maven project even if a Java version >= 9 is specified by the maven.compiler.release property (as of October 2020, that is Eclipse version 2020-09 including Maven version 3.6.3): Maven by default uses version 3.1 of the Maven compiler plugin, while the release property has been introduced only in version 3.6.
So don't forget to include a current version of the Maven compiler plugin in your pom.xml when using the release property:
15
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
Or alternatively but possibly less prominent, specify the Java version directly in the plugin configuration:
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
15
This picks up Line's comment on the accepted answer which, had I seen it earlier, would have saved me another hour of searching.