New project
Create a new project in IntelliJ IDEA.
You can use the New Project Wizard to create a new project in IntelliJ IDEA. If you select the option to Add sample code, IntelliJ IDEA will add sample code to your project, containing a class with a main method.
If you select IntelliJ as your Build system, set JDK to 25, the sample code will be a compact source file and instance main method, introduced in Java 25.