Consider code like:
---
main() {}
---
this will produce:
---
$ javac --enable-preview --source 24 /tmp/F.java
/tmp/F.java:1: error: class, interface, enum, or record expected
main() {}
^
1 error
---
while the real problem is that the `main` method is missing a return type.
---
main() {}
---
this will produce:
---
$ javac --enable-preview --source 24 /tmp/F.java
/tmp/F.java:1: error: class, interface, enum, or record expected
main() {}
^
1 error
---
while the real problem is that the `main` method is missing a return type.
- duplicates
-
JDK-8340545 Launcher error message unhelpful when instance main method has no void modifier
- Closed
- links to
-
Commit(master) openjdk/jdk/b8727181
-
Review(master) openjdk/jdk/20591