I'm working with this tutorial which uses lambda expressions.

[Spring Boot - Bookmarks](http://spring.io/guides/tutorials/bookmarks/)

But IntelliJ says always: `cannot resolve method(<lambda expression>)`.

What do I have to check?

```
this.accountRepository.findByUsername(userId).orElseThrow(() -> new UserNotFoundException(userId));

```
['https://Stackoverflow.com/questions/33053891', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2715720/']
It looks like your IntelliJ or your project is not setup to use Java 8.

1. Open **Project Structure**
2. Look into **Project Settings | Project**, the value of **Project SDK** should be 1.8
3. Look into **Platform Settings | SDK**, there should be 1.8 listed

It should look something like this:

[![enter image description here](https://i.stack.imgur.com/jaAE9.png)](https://i.stack.imgur.com/jaAE9.png)
You need to change the "Project language level" to "8 - Lambdas, type annotations etc.". You can find this option in "Project Settings" -> "Project"