Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to set IntelliJ IDEA to support lambda expressions

Shulou Source: shulou.com Published: 2022-06-01 01:03:24 10月04日 Update

This article mainly introduces how to set up IntelliJ IDEA to support lambda expression, the article is very detailed, has a certain reference value, interested friends must read it!

Using IntelliJ IDEA as a development tool, for maven-based java projects, if you want to write lambda expressions, make sure that jdk1.8 or higher is installed and used, and then make some settings before you can compile and execute normally, as shown in maven support and intellij idea tool support. The configuration is as follows:

# # maven supports # # add a plug-in to pom.xml to make maven support jdk1.8 syntax:

Org.apache.maven.plugins maven-compiler-plugin 3.2 1.8 1.8 modify one of the intellij idea configurations: modify the global settings of intellij # #

Next is the global settings for intellij. Select the global settings in the menu, as shown in the red box below:

In the pop-up menu, set the level of Java compiler to 1.8.The specific settings are shown in the red box below:

Modify intellij idea configuration II: modify project configuration # #

Then, the attributes of the project project support lambda. Right-click on the project and select "Open Modular Settings", as shown below:

Select "8-Lambdas" from the language level in the pop-up menu, as shown below:

Complete and use

After these settings are completed, the lambda expression can be written in the code, and ide will automatically prompt, as shown in the following figure:

The above is all the content of the article "how to set IntelliJ IDEA to support lambda expressions". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Support expression project configuration global menu selection content tools article project next two code value interest buddy partner attribute development tool Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Redmi Xiaomi Apple Shulou Tech Info