On 7/9/2026 4:12 PM, David Holmes wrote:
src/java.base/share/man/java.md line 99:
97: By default, the first argument that isn't an option of the `java` command
indicates
98: the fully qualified name of the main class. If `-jar` is specified, then its
99: argument is the name of the JAR file containing class and resource files
for the
Pre-existing: this doesn't account for the `-m` module mode.
The goal of this PR is solely to record the new-in-25 possibilities for
the main() method.
src/java.base/share/man/java.md line 103:
101: the manifest of the JAR file.
102:
103: Arguments after the main class name or the JAR file name are passed to
Pre-existing: this doesn't account for the `-m` module mode.
The goal of this PR is solely to record the new-in-25 possibilities for
the main() method.
src/java.base/share/man/java.md line 104:
102:
103: Arguments after the main class name or the JAR file name are passed to
104: the `main()` method. The `main()` method may be a static method or an
instance
I would suggest starting a new paragraph to describe what a `main` method may
look like.
The real problem is that we say arguments are passed to the main()
method but then we allow main() to omit parameters ... people around the
world are going to ask for the next 30 years, "Where do the arguments go
if main() has no parameters?"
This high-profile opening text is not the place to dive deeply, so we
need to finesse the wording to avoid the question. The proposal below
relocates the argument passing (implying that command-line-arguments are
passed through to main()-arguments), and continues to present
main-is-static and main-takes-String[] as first-among-equals.
-----
By default, the first argument ... in the manifest of the JAR file.
The `main()` method may be a static method or an instance method. It may
declare a `String` array parameter for arguments passed to the `java`
command after the main class name or the JAR file name; alternatively,
it may declare no parameters. It must not return any value, and must
have `public`, `protected`, or package access. The method declaration
typically has one of the following forms:
public static void main(String[] args)
public static void main()
void main(String[] args)
void main()
---
Alex