JEP 330

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu May 31 21:37:53 UTC 2018


Cay,

Simplifying "public static void main" is something that has been 
discussed, and would be a change to JLS and javac.

Nothing in this JEP precludes that further work, which is another of the 
reasons why this JEP is careful to avoid changing JLS and javac. If and 
when JLS changes to permit a simpler main program, then I would expect 
this launcher work to be able to trivially leverage such changes.

-- Jon

On 05/31/2018 02:19 PM, Cay Horstmann wrote:
> Hi Jon,
>
> as it happens, teaching Java to beginners is something that I do a 
> lot. In twenty years, I have never met any beginner who was seriously 
> struggling with javac vs. java. There are many other issues that 
> confuse beginners, starting with public, static, void, main, and args. 
> As I point out in my blog, that confusion could be remedied by a 
> better launcher that is willing to instantiate a class. That would be 
> a large win for beginners.
>
> Also, beginners often start with an IDE that hides javac and java from 
> them for a while. When they get to the point where they use the 
> command line tools, they have probably already encountered multiple 
> classes.
>
> If the motivation of the JEP is to provide shebang support, sure. But 
> from a teaching perspective, I don't see how it is a win.
>
> Cheers,
>
> Cay
>
> Le 31/05/2018 à 11:54, Jonathan Gibbons a écrit :
>
>>
>> Cay,
>>
>> The intent of the feature, as relates to easing the Java learning 
>> curve, is to assist in the first few "baby steps" that some folk 
>> might take when starting to learn Java.
>>
>> The intent is that for folk starting out from scratch, learning to 
>> use one command (java) is simpler than learning to use two (java and 
>> javac).  Once they are familiar with using java to run simple small 
>> programs, then they can progress to using javac and java for programs 
>> using many files.  Then, the next possible step on the ladder is to 
>> learn the jar command to make an executable.
>>
>> If you are teaching folk at a level where they are already more 
>> familiar with command-line tools, then yes, you may want to skip the 
>> ability to use the Java launcher to execute single-file source code 
>> programs.
>>
>> -- Jon
>
>



More information about the compiler-dev mailing list