![]() This seems to be the case as shown in the next screen snapshot where I attempt to run this feature against the same code as above, but now with the file name helloYou. java extension (which extension would be reserved for traditional Java source files). I highlighted in my post “ Shebang Coming to Java?” that it sounded like single-file source programs used with this JEP 330 support were not going to be allowed to end with the. The following screen snapshot demonstrates that it works when I pass the flags -source=11 and -enable-preview to the Java launcher. ![]() This error occurs because the JEP 330 support in this early access build is a “preview” feature. When I try to run this file directly with OpenJDK 11 EA-24, I see an error (“Could not find or load main class helloYou.jv”): In fact, I started the file’s name with a lower case letter! java extension that regular Java source code files end with and I did not match the name of the file to the name of the class. Public static void main(final String args)įinal String name = nsole().readLine("\nPlease enter your name: ") To demonstrate this feature, I’m going to use a simple example adapted (very slightly) from that provided in the Mario Torre post on the OpenJDK jdk-dev mailing list. (to execute a single source-file program)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |