-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Setting java.source_level and java.target_level to 7 not effective? #964
Comments
/CC @davido |
Let's check the Java Compiler specification:
There is even an example exactly for this use case, with the explanation:
It seems that buck doesn't support custom bootstrap class path yet in buckconfig file: https://buckbuild.com/concept/buckconfig.html#java. Needless to say that Apache Ant supports this feature:
I modified your example, to include non Java 7 construct, lambda:
Now it's failing as expected, but only because of
|
OK, I was wrong. It's there:
So what you (or GerritForge CI) want to set in
One confusing thing is: while this section is called |
Setting
is failing with:
|
So, I figured it out, it should be:
Now, when I reverting this fix to break stable-2.13 branch again: [1], and building it with Java 8:
|
Thanks for the investigation @davido ; It would be good if we could put this in the |
Yes, exactly, we cannot do that as the locations may differ. |
In my environment I have Java 8:
But the project being built is targetted for Java 7 runtime.
If the
source_level
andtarget_level
are set to7
(or not set, and they default to7
anyway), and if some Java 8 specific language feature creeps in, I expect that it should not compile.Small reproducer project here: https://github.com/dpursehouse/buck_source_level
The text was updated successfully, but these errors were encountered: