<div dir="ltr">Hello!<div><br></div><div>The following message related to JEP 495 "Simple Source Files and Instance Main Methods" was posted by my colleague, Mikhail Pyltsin, to compiler-dev, but probably it belongs better to amber-dev. Mikhail told me that he has trouble posting to amber-dev. According to him, messages go to the moderation queue and never appear on the list. Now, I'm reposting his message under my name, as the problem looks somewhat important to me. The original message follows.</div><div><br></div><div>Hi!<br>Sorry, I am not sure that it is a correct channel, but probably, it is<br>related to jep specification.<br>I am investigating a new version of  jep495<br>(<br><a href="https://cr.openjdk.org/~gbierman/jep495/jep495-20241101/specs/simple-source-files-instance-main-methods-jls.html#jls-12.1.3">https://cr.openjdk.org/~gbierman/jep495/jep495-20241101/specs/simple-source-files-instance-main-methods-jls.html#jls-12.1.3</a><br>)<br>and came up with such an example:<br>```java<br>public abstract class AbstractClass {<br>    public static void main() {<br>        System.out.println("Hello, World!");<br>    }<br><br>    public void main(String[] args) {<br>        System.out.println("Hello, World! no constructor, non-static,<br>args");<br>    }<br>}<br>```<br>Right now java chooses `void main(String[] args) ` because it contains<br>argument, but cannot create this class, because it is abstract,<br>I have got this error: `Exception in thread "main"<br>java.lang.InstantiationException: AbstractClass`<br>Could you help me if this is expected? I expect that `public static void<br>main()` will be chosen.<br><br>I cannot find anything related to this in JEP except this one:<br>`The behavior of an implementation if there is no candidate method to<br>invoke, or if there is no suitable constructor in the initial class when<br>invoking an instance candidate method, is beyond the scope of this<br>specification.', but it doesn't contain this case.</div><div><br></div><div><br></div><div>With best regards,</div><div>Tagir Valeev</div></div>