-
Enhancement
-
Resolution: Unresolved
-
P3
-
None
-
None
-
None
To smooth the "on ramp" for beginning programmers, the Java language is introducing unnamed classes (not to be confused with anonymous classes). This introduces an interaction with the Main-Class attribute in the JAR File Spec, which relies on "the *class name* of the main application class".
Overview: https://openjdk.org/jeps/445#Unnamed-classes
Spec: https://cr.openjdk.org/~gbierman/jep445/latest/
Compiling an unnamed class in a source file results in an ordinary class file on disk, so it is technically possible to specify its class name (yes, of the "unnamed" class) in the Main-Class attribute.
However, we do not recommend that such a class file should be packaged into a JAR as the "main application class". Any educational establishment which tells its students to package up an unnamed class, rather than a named class, is on the wrong road.
It would be helpful if the JAR File Spec clarified that only a named class should be used as the main application class in a JAR file.
Overview: https://openjdk.org/jeps/445#Unnamed-classes
Spec: https://cr.openjdk.org/~gbierman/jep445/latest/
Compiling an unnamed class in a source file results in an ordinary class file on disk, so it is technically possible to specify its class name (yes, of the "unnamed" class) in the Main-Class attribute.
However, we do not recommend that such a class file should be packaged into a JAR as the "main application class". Any educational establishment which tells its students to package up an unnamed class, rather than a named class, is on the wrong road.
It would be helpful if the JAR File Spec clarified that only a named class should be used as the main application class in a JAR file.