The Java source launcher executing a single source file that with a shebang line should ignore any module-info.java file present in the program's root directory. As per JEP 458:
Step 1:
If the file begins with a "shebang" line, that is, a line that starts with #!,
then the source path passed to the compiler is empty so that no other
source files will be compiled. Proceed to step 4.
An error message can read like this:
module-info.java:4: error: file should be on source path, or on patch path for module
module helper {
^
1 error
error: compilation failed
In such cases, no error should be raised and the program be run on the classpath.
Step 1:
If the file begins with a "shebang" line, that is, a line that starts with #!,
then the source path passed to the compiler is empty so that no other
source files will be compiled. Proceed to step 4.
An error message can read like this:
module-info.java:4: error: file should be on source path, or on patch path for module
module helper {
^
1 error
error: compilation failed
In such cases, no error should be raised and the program be run on the classpath.
- links to
-
Review(master)
openjdk/jdk/30019