You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finalizes support for instance main methods and compact source files, simplifying the traditional main method requirements. This allows simpler program entry points without the boilerplate of public static void main(String[] args).
Instance Main Methods
Instance main methods use a void main() signature (or void main(String[] args)), where the JVM automatically creates an instance of the class before invoking it. These eliminate the need for static and public modifiers for basic programs, making Java more accessible for beginners. For example:
The Java launcher handles instantiation seamlessly.
Compact Source Files
Compact source files extend this by allowing executable code without an explicit class declaration, using .java files with just the main method. This works for single-file programs and supports implicit imports for common APIs. Oracle docs confirm this as a standard feature in Java 25.
it seems google-java-format intellij plugin throws parsing error for the file. Can this be fixed.
Activity
cushon commentedon Jan 19, 2026
google-java-format doesn't support this yet, that is tracked by #1216
Note that once support is added it will still need to be running on a JVM version that supports the new version, this is similar to #1278 (comment)