I know it's too late for an answer. Hope someone else finds this helpful.
I tried to do it the exact same way. I wanted to do something like
public class Example { public static void main(String[] args) { Example sol = new Example(); } }
I ended up setting up a code template that automatically generates the above for me.
Edit the template in Settings> Java> Code Style> Code Templates> Code> Class Body> Edit
By adding the following template, I will generate what I need
public static void main(String[] args) { ${type_name} sol = new ${type_name}(); }
For your use case, the below template should do it.
public static void main(String[] args) throws Exception { }
source share