Draft JEP: Launch Single-File Source-Code Programs

Robert Zenz robert.zenz at sibvisions.com
Fri Feb 9 11:13:17 UTC 2018

I fail to see why a shebang would be required at all for this proposal, can't
`java` figure out that it was handed a source code file (ends with .java and is
not a class file or jar)? Or alternately provide a switch to run source files?

On 09.02.2018 11:51, Volker Simonis wrote:
> Hi Jonathan,
> that's an interesting proposal. It is just unfortunate that a Java
> source file starting with "shebang" won't be a legal Java file
> according to the Java Language Specification. Or do you plan to change
> the JLS to allow (and ignore) "shebang" in the first line?
> Thanks,
> Volker
> On Fri, Feb 9, 2018 at 12:18 AM, Jonathan Gibbons
> <jonathan.gibbons at oracle.com> wrote:
>> This draft JEP contains a proposal to enhance the java launcher to support
>> running a
>> program supplied as a single file of Java source code. The program will be
>> compiled
>> and run, without the need to explicit invoke javac, or to package up a jar
>> file.
>> For more details, see:
>> http://openjdk.java.net/jeps/8192920
>> -- Jon

More information about the jdk-dev mailing list