diff --git a/java/java-impl/resources/META-INF/JavaPlugin.xml b/java/java-impl/resources/META-INF/JavaPlugin.xml
index a69453df7386..7fd3689d4fc8 100644
--- a/java/java-impl/resources/META-INF/JavaPlugin.xml
+++ b/java/java-impl/resources/META-INF/JavaPlugin.xml
@@ -1242,7 +1242,6 @@
-
diff --git a/java/java-impl/src/com/intellij/codeInsight/template/macro/StringArgsMacro.java b/java/java-impl/src/com/intellij/codeInsight/template/macro/StringArgsMacro.java
deleted file mode 100644
index 2cbe4b51fa40..000000000000
--- a/java/java-impl/src/com/intellij/codeInsight/template/macro/StringArgsMacro.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
-package com.intellij.codeInsight.template.macro;
-
-import com.intellij.codeInsight.lookup.LookupElement;
-import com.intellij.codeInsight.lookup.LookupElementBuilder;
-import com.intellij.codeInsight.lookup.LookupFocusDegree;
-import com.intellij.codeInsight.template.*;
-import org.jetbrains.annotations.NotNull;
-
-public final class StringArgsMacro extends Macro {
-
- @Override
- public String getName() {
- return "stringArgs";
- }
-
- @Override
- public @NotNull String getDefaultValue() {
- return "";
- }
-
- @Override
- public Result calculateResult(Expression @NotNull [] params, ExpressionContext context) {
- return null;
- }
-
- @Override
- public LookupElement[] calculateLookupItems(Expression @NotNull [] params, final ExpressionContext context) {
- return new LookupElement[]{LookupElementBuilder.create("String[] args")};
- }
-
- @Override
- public boolean isAcceptableInContext(TemplateContextType context) {
- return context instanceof JavaCodeContextType.NormalClassDeclarationAfterShortMainMethod ||
- context instanceof JavaCodeContextType.ImplicitClassDeclaration;
- }
-
- @Override
- public @NotNull LookupFocusDegree getLookupFocusDegree() {
- return LookupFocusDegree.UNFOCUSED;
- }
-}
diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.java
index f9a771a1998b..797427691593 100644
--- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.java
+++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.java
@@ -821,12 +821,8 @@ public class JavaLiveTemplateTest extends LiveTemplateTestCase {
""");
final TemplateImpl template =
- TemplateSettings.getInstance().getTemplate("psvm", "Java//Instance 'main' methods for implicitly declared classes");
+ TemplateSettings.getInstance().getTemplate("psvma", "Java//Instance 'main' methods for implicitly declared classes");
startTemplate(template);
- LookupElement[] elements = myFixture.getLookupElements();
- LookupElement last = elements[elements.length - 1];
- myFixture.getLookup().setCurrentItem(last);
- myFixture.finishLookup(Lookup.NORMAL_SELECT_CHAR);
myFixture.checkResult(
"""
void main(String[] args) {
@@ -851,7 +847,6 @@ public class JavaLiveTemplateTest extends LiveTemplateTestCase {
""");
final TemplateImpl template = TemplateSettings.getInstance().getTemplate("main", "Java//Instance 'main' methods for normal classes");
startTemplate(template);
- myFixture.type("\n");
myFixture.checkResult(
"""
class A{
diff --git a/platform/lang-api/resources/messages/CodeInsightBundle.properties b/platform/lang-api/resources/messages/CodeInsightBundle.properties
index f8a98251c505..877114574e5b 100644
--- a/platform/lang-api/resources/messages/CodeInsightBundle.properties
+++ b/platform/lang-api/resources/messages/CodeInsightBundle.properties
@@ -193,7 +193,10 @@ livetemplate.description.lst=Fetches last element of an array
livetemplate.description.mn=Sets lesser value to a variable
livetemplate.description.mx=Sets greater value to a variable
livetemplate.description.psvm=main() method declaration
-livetemplate.description.short.psvm=Instance main() method declaration
+livetemplate.description.short.static.psvm=static void main()
+livetemplate.description.short.static.psvma=static void main(String[] args)
+livetemplate.description.short.psvm=void main()
+livetemplate.description.short.psvma=void main(String[] args)
livetemplate.description.toar=Stores elements of java.util.Collection into array
livetemplate.description.lazy=Performs lazy initialization
livetemplate.description.if.not.null=Inserts 'if not null' statement
diff --git a/resources/src/liveTemplates/JavaImplicitClass.xml b/resources/src/liveTemplates/JavaImplicitClass.xml
index 73cfb0ed5696..596f9750e7f0 100644
--- a/resources/src/liveTemplates/JavaImplicitClass.xml
+++ b/resources/src/liveTemplates/JavaImplicitClass.xml
@@ -1,15 +1,26 @@
-
+ name="psvm" toReformat="true" toShortenFQNames="true" value="void main(){
$END$
}">
-
+ name="main" toReformat="true" toShortenFQNames="true" value="void main(){
$END$
}">
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/src/liveTemplates/JavaNormalClassesWithInstanceMain.xml b/resources/src/liveTemplates/JavaNormalClassesWithInstanceMain.xml
index 40a54f372d65..26a9db3bcad3 100644
--- a/resources/src/liveTemplates/JavaNormalClassesWithInstanceMain.xml
+++ b/resources/src/liveTemplates/JavaNormalClassesWithInstanceMain.xml
@@ -1,15 +1,26 @@
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+