Draft JEP: Launch Single-File Source-Code Programs
david.lloyd at redhat.com
Mon Feb 12 20:59:42 UTC 2018
On Mon, Feb 12, 2018 at 2:26 PM, Jonathan Gibbons
<jonathan.gibbons at oracle.com> wrote:
> On 02/12/2018 11:43 AM, David Lloyd wrote:
>> Sorry if I just missed this somehow, but how would one set the Java
>> source version in use? This seems like it would be necessary in order
>> to ensure forwards-compatibility.
> This would only be an issue for shebang files; if you are using the Java
> launcher explicitly, the source version would be the default version
> for the Java launcher. For shebang files, it is normal practice to put
> an absolute pathname for the executable. If you are concerned about
> long term compatibility, you could use the path for a specific version
> of JDK.
I don't think you can really assume that specific versions of the JDK
will always be present at specific locations on most operating systems
and installations. Probably what is going to happen in reality is
that there will be scripts out there, and some hapless user will
upgrade their OS JDK, and everything will break. I think that
specifying a source version will probably be necessary.
More information about the compiler-dev