Lambda expressions in this language are not supported by IDEA

I am trying to create my first jx jxml project and at the initialization stage I am trying to set the factory cell value for a table column, e.g.

@FXML private void initialize() { agentId.setCellValueFactory(cellData -> cellData.getValue().getIdProperty()); .....} 

and it is underlined in red and gives the error indicated in the header. Changing the language level in the project structure does not have an effect. What else could be causing the error?

UPD: I found that you need to install java with lambdas, which is not included in the official version. I did it, and yet it did not help. I downloaded it here

+7
source share
6 answers

The answer is this: I had to change the language level not only in the project-> project structure, but also in the project-> modules structure.

+11
source

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

  • File> Project Structure> Project> Project SDK: change it to Java 1.8.XX
  • File> Project structure> Project> Language level: SDK 8 (in my case, the SDK value was already 8)
  • File> Project Structure> Modules> Sources> SDK 8 (in my case, the SDK value was already 8)
  • File> Settings> Build, Run, Deploy> Compiler> Java Compiler> Project Byte Code Version> 1.8
  • File> Settings> Build, Run, Deploy> Compiler> Java Compiler> Version for the bytecode in the module> Target version of the bytecode> 1.8

That should do the trick.

+19
source

If you are using Android Studio version 3.2.1, you can change the language level by following these steps:

  1. Go to project structure
  2. In the modules section, click on the application.
  3. On the properties tab, change Source Compatibility to 1.8.
+3
source
  1. Click "File" in the upper left corner of Android Studio.
  2. Click on the project structure.
  3. Click on the app.
  4. Select "Properties" and set "Source Compatibility" to 1.8 .
+2
source

If you went through the above and still have not fixed it, and if you are setting up a new module, check that the source folder of the module is not added to the parent module. I found that it was compiled in 1.5 since it was a parameter of the parent module (since the parent element did not contain the java source). Updating what to 1.8 also finally got rid of the warning and deleting the source module folder from the parent module. File> Project Structure> Modules (parent module)> Sources> Language Level

+1
source

For Android Studio version 3.3:

  1. Click “File” (top left corner in “Android Studio”).
  2. Click on "Project Structure".
  3. Click "Application" (in the "Modules" section).
  4. On the Properties tab, change the Source Compatibility to 1.8.
  5. On the Properties tab, change the Target Compatibility to 1.8.

This solution worked for me.

0
source

All Articles