Hi all, when we are using IntelliJ sometimes we need to set the right language level by using module settings. We will set the language setting as JAVA 8 as shown below.
And also in settings, we set the bytecode version as 1.8 as shown below.
In order to do these settings manually, we can also set the java version in our pom.xml and then maven will compile our project with these settings. Here is the way that we can do these settings in pom.xml.
First, we can use properties:
<properties> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> </properties>
Or, we can use maven compiler plugin:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build>
Thanks.
Onur Baskirt

Onur Baskirt is a Software Engineering Leader with international experience in world-class companies. Now, he is a Software Engineering Lead at Emirates Airlines in Dubai.