Over a million developers have joined DZone.

Use Lambda Expressions Without Java 8

DZone's Guide to

Use Lambda Expressions Without Java 8

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

One of the things that makes developers excited about Java 8 is the ability to use lambda expressions in their code. But what if you are using an earlier version of Java? Esko Luontola has the answer for you!  

After asking if anything existed that backported lambda expressions to Java 7, and getting no answers, he just went ahead an built Retolambda  himself.  The project works as follows: 

 will take bytecode compiled with Java 8 and convert it to run on Java 7, 6 and 5 runtimes, letting you use  lambda expressions and  method references on those platforms.

What I love about this story is how, on seeing there was no library available for what he needed, Esko built it himself; no complaining about how it didn't exist, just code and build. True innovation and drive.

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.


Published at DZone with permission of James Sugrue, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}