Confusing javac error :)
David Holmes
david.holmes at oracle.com
Fri Nov 30 04:20:35 PST 2012
On 30/11/2012 8:45 PM, Remi Forax wrote:
> On 11/30/2012 11:30 AM, Remi Forax wrote:
>> On 11/30/2012 11:06 AM, David Holmes wrote:
>>> On 30/11/2012 5:15 PM, Remi Forax wrote:
>>>> Yes, the default version should be 8.
>>> ?? I specified:
>>>
>>> -source 8
>>>
>>> ;-) Hence the confusion regarding the error.
>>>
>>> David
>> doh, I see really weird.
>>
>> Rémi
>
> Ok, got it,
> The version of the compiler shipped with b65 has lambda disabled with a
> non standard flag
> /usr/jdk/jdk1.8.0/bin/javac -XDallowLambda Test.java
>
> changeset 01c9d4161882 enable lambda by default:
> http://hg.openjdk.java.net/jdk8/jdk8/langtools/diff/01c9d4161882/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
> so b66 will have lambda enabled by default.
Ah! Thanks Remi. The person (who shall remain nameless) who told me I
could use a regular build to test lambdas failed to mention that :)
Cheers,
David
> Rémi
>
>
>>
>>>> Rémi
>>>>
>>>> Sent from my Phone
>>>>
>>>> ----- Reply message -----
>>>> From: "David Holmes"<david.holmes at oracle.com>
>>>> To: "lambda-dev at openjdk.java.net"<lambda-dev at openjdk.java.net>
>>>> Subject: Confusing javac error :)
>>>> Date: Fri, Nov 30, 2012 05:09
>>>>
>>>>
>>>> javac -J-showversion -source 8 TestLambda.java
>>>> java version "1.8.0-ea"
>>>> Java(TM) SE Runtime Environment (build 1.8.0-ea-b65)
>>>> Java HotSpot(TM) Client VM (build 25.0-b09, mixed mode)
>>>>
>>>> TestLambda.java:13: error: lambda expressions are not supported in
>>>> -source 1.8
>>>> Runnable r = () -> System.out.println("Run") ;
>>>> ^
>>>> (use -source 8 or higher to enable lambda expressions)
>>>> 1 error
>>>>
>>>> ----
>>>>
>>>> This is a mainline build of jdk8-b65 so this may already be fixed.
>>>>
>>>> David
>>>>
>>
>
>
More information about the lambda-dev
mailing list