January 28, 2020 /   java   java 13   enable preview features

Java 13 was released with some cool features as preview. Preview features are not enabled by default. Here are the ways to enable preview features as per use case.

Command Line


javac --enable-preview --release 13 ClassName.java


java --enable-preview ClassName

IntelliJ IDEA

Go to File -> Project Structure -> Project Language Level


Provide --enable-preview in command line arguments for each java plugin.