New live templates for main methods
Create an instance main method using a live template.
IntelliJ IDEA has some new live templates to add a main method to an implicit class, either with or without arguments: main
, maina
, psvm
, psvma
. Using the live templates psvm
or main
inside a compact source file will add the new main method, while they will continue to add the classic main method inside a class, as you can see in the preview.
- (blog) IntelliJ IDEA Blog - Java 25 LTS and IntelliJ IDEA
- (video) IntelliJ IDEA. Helen's Take On: Writing Less Code
- (video) IntelliJ IDEA. Write Code Faster Using Live Templates
- (video) IntelliJ IDEA Pro Tips: Live Templates
- (documentation) IntelliJ IDEA Help - Using Live Templates
- (documentation) IntelliJ IDEA Help - Creating Live Templates
- (documentation) IntelliJ IDEA Guide - Create a Custom Test Live Template