Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Error on this fetchAllContacts().stream().forEach(System.out::println);

Error:(33, 57) java: method references are not supported in -source 1.5
  (use -source 8 or higher to enable method references)
,,,

I get this error in Intelij I downloaded the library from GitHub

I understand it is because of the error of java version as the stream().forEach(....
is java 8 for each method

How I can run this

2 Answers

Your java version must be 1.8. If you are using gradle for this project open the build.gradle file and check sourceCompatibility it must be 1.8. I assume that you have the latest java update.

Oki I refreshed the dependencies by changing in sourceCompatibility = 1.8 and now its working. Thanks for the hint