Enable Java 14 Record in Intellij
How to enable record feature in intellij. You cannot create a Record in intellij even though you select JDK 14 as your compiler for your project . There need to be some config changes in intellij to enable this. This tutorial will talk more about the configuration
First let us create a Java Project in intellij
Go ahead and create a maven based java project in intellij . Make sure you select JDK 14 as the SDK
Let us name the project as Java14Record and hit the Finish button.
The project is created, nothing fancy. A basic maven based java project . After that let us create a Record in this project. I could not locate the option from the menu. So that is what we are trying to configure.
Go to project settings and select the option project from the side menu. There is one section in the right hand side of the window to select the Project language level. Select the option which has Records, patterns, text blocks
Then select the option module from the side menu and set the language level to same what did just now, which is Records, patterns, text blocks. Then click apply . Good job !
Now create a java class, you can see the same menu with Record as an option. Go ahead and select that option and create a record
Your first record is created. wow