Maven: Viewing compile options?

I'm trying to track down this compile error:

$ mvn compile
[ERROR] /.../[14,13] try-with-resources is not supported in -source 1.5
(use -source 7 or higher to enable try-with-resources)

How can find the -source 1.5 setting in my Maven compilation? I'm using a plain vanilla pom.xml which (as far as I can tell) isn't setting anything.


This is because you are using a plain vanilla pom.xml that you have this issue.

By default, the maven-compiler-plugin, which is called when compiling the sources, compiles with Java 5, whatever you have set up as $JAVA_HOME:

Also note that at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with.

To use a different compiler version (e.g. Java 8), you can set the following properties:


or configure the plugin directly:


Need Your Help

Visual studio debugger not working

c++ visual-studio debugging remote-debugging

I am using Microsoft Visual Studio debugger to debug a remote application. These are the steps I have done

Page refresh instead of Ajax Load without

php javascript jquery mysql ajax

On form submit i want to load a div with an updated list of a mysql table. I'am sending the form variables across to a php and posting them into a mysql table. the same page displays the full table...