This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Features new in Java 8 and the fly likes lambdas and Java 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Features new in Java 8
Bookmark "lambdas and Java 7" Watch "lambdas and Java 7" New topic

lambdas and Java 7

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Hi author,

I haven't yet downloaded Java 8 JDK but I was wondering if java 8 compiler can compile code having lambdas targetting java 7 JVM.


Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9956

The answer is no and yes. No it does not work out of the box, yes with a tool like Retrolambda ( you can port it to Java 7.

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Awesome. Thanks Joe.
I agree. Here's the link:
subject: lambdas and Java 7
It's not a secret anymore!