lambda expressions are not supported at this language level IDEA

I had to do a few things to get rid of this problem.

  1. File > Project Structure > Project > Project SDK: Change it to Java 1.8.XX
  2. File > Project Structure > Project > Language Level: SDK 8 (in my case SDK default was already 8)
  3. File > Project Structure > Modules > Sources > SDK 8 (in my case SDK default was already 8)
  4. File > Settings > Build, Execution, Deployment > Compiler > Java Compiler > Project bytecode version > 1.8
  5. File > Settings > Build, Execution, Deployment > Compiler > Java Compiler > Per-module bytecode version > Target bytecode version > 1.8

That should do the trick.


the answer is the following: I had to change the language level not only in project structure->project but in project structure-> modules too.


If you are use Android Studio version 3.2.1 ,you can change the language level using below mention steps:

  1. Go to project structure
  2. Under modules section,click on app.
  3. In the properties tab, change the Source Compatibility to 1.8.