Turn on Preview Features to try new Java features

The latest versions of Java contain "Preview Features", features that are fully functional but require developer feedback. Try them out in IntelliJ IDEA.

If you want to use preview features in the latest versions of Java in IntelliJ IDEA, you need to set the language level to "Preview".

Go to Project Structure, ⌘; (macOS) or Ctrl+Alt+Shift+S (Windows/Linux), make sure you have the correct JDK selected, and pick the "Preview" option from the Language Level dropdown.