Andrunevchyn

Andrunevchyn


October 2017
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories


Setting the -source and -target of the Java Compiler on Maven

Andriy AndrunevchynAndriy Andrunevchyn

It’s not necessary to add compiler plugin to your project when you want to set  -source/-target  java version. Just add following properties, which are the default property names for the plugin parameters.

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

Pay attention! For Java 9 it will be version 9 not 1.9

<properties>
    <maven.compiler.source>9</maven.compiler.source>
    <maven.compiler.target>9</maven.compiler.target>
  </properties>

source

Comments 0
There are currently no comments.