Executing chimera scripts using the flexible launch protocol (as specified by JEP 463) and implicitly declared classes (same JEP) returns error: bad file name when run with the source code launcher (i.e. java --source <version> --enable-preview, see JEP 330) on Windows and Linux (but I'd imagine on all platforms).
Interestingly, when I discard the protocol and create a dedicated public class with main method that's public, static and accepts an array of strings as its first parameter, everything works correctly - proving the script itself is not at fault:
@/*/ '"' 2>/dev/null || true #" 2>nul || setlocal && echo off && goto :cmd.exe
exec java --source 22 --enable-preview "${0}" "${@}"
exit
:cmd.exe
(for /f delims^= %%c in (^""%ComSpec%"^") do (goto) 2>nul || title^ %%~c) ^
&& java --source 22 --enable-preview "%~dpnx0" %*
goto :EOF
@/*/SuppressWarnings("")
public class Main {
public static void main(String... args) {
System.out.println("Write once, run anywhere");
}
}
Please provide a brief summary of the bug
Executing chimera scripts using the flexible launch protocol (as specified by JEP 463) and implicitly declared classes (same JEP) returns
error: bad file name
when run with the source code launcher (i.e.java --source <version> --enable-preview
, see JEP 330) on Windows and Linux (but I'd imagine on all platforms).Did you test with the latest update version?
Please provide steps to reproduce where possible
amber.cmd
:Windows:
Linux:
Expected Results
Actual Results
What Java Version are you using?
What is your operating system and platform?
Windows:
Linux:
How did you install Java?
Windows:
Linux:
Did it work before?
No.
Did you test with other Java versions?
Java 21 LTS
Addendum
Interestingly, when I discard the protocol and create a dedicated public class with
main
method that's public, static and accepts an array of strings as its first parameter, everything works correctly - proving the script itself is not at fault: