Idea, a workaround found when a Java syntax is not supported in a lower version

Source: Internet
Author: User

For example, in a project, prepare to use the java.util.objects#equals syntax, found that the hint version is not supported.

F4 View the configuration of module, it turns out to be version 1.6.

When I manually modified to 1.8, I was prompted: module is the Java version in Maven configuration.

So, to the Pom file, it is found that the default starter of spring boot is Java 1.6.

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>

So I tried to add it in my own child pom:

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<java.encoding>UTF-8</java.encoding>
</properties>
To overwrite the default starter configuration.
And then it's OK.

Idea, a workaround found when a Java syntax is not supported in a lower version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.