Java - Eclipse lambda expressions are not supported in -source 1.7

Hi, Trying to build a java project in Eclipse Neon and I'm getting the error below. When I look at the Java compiler settings for the project it shows as using 1.8 so I'm not sure where it is getting the 1.7 from. My java version is 1.8.0.51. Is there another eclipse settings somewhere which might still be referring to 1.7

lambda expressions are not supported in -source 1.7
  (use -source 8 or higher to enable lambda expressions)

Thanks
victoriaharryAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Is it a project that we can look at online?
0
victoriaharryAuthor Commented:
no sorry, it is on a client site.
0
victoriaharryAuthor Commented:
I'm guessing the lambada expressions in the code below is causing the issue. Alternatively if there is a way to swap these out so I don't have to use them would work as well

 
List<TestOutcome> testOutcomes = serenityRunner.getTestOutcomes();
            testOutcomes.stream().forEach(outcome -> {
                System.out.println("Outcome");
                System.out.println(outcome);
                System.out.println(outcome.getCompleteName());
                System.out.println(outcome.getConciseErrorMessage());
                System.out.println(outcome.getErrorMessage());
                System.out.println(outcome.getTestFailureCause());
                System.out.println(outcome.getTestFailureMessage());
                System.out.println(outcome.getTestFailureSummary());
            });
            
            sampleResult.setSuccessful(true);
            
            Optional<TestOutcome> firstFailure = testOutcomes.stream().filter(outcome -> outcome.isError() || outcome.isFailure()).findFirst();
            firstFailure.ifPresent(failed -> {
                sampleResult.setSuccessful(false);
                sampleResult.setResponseData(failed.getTestFailureMessage(), null);
                sampleResult.setDataType(SampleResult.TEXT);
            });

Open in new window

0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

CEHJCommented:
I could probably rewrite that for you, but you'd probably be better off waiting for someone who knows Eclipse well. I don't really use it
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Can you provide a screenshot of your Java Compiler settings for your project? Also, are you using Maven?
0
victoriaharryAuthor Commented:
Compiler settings in eclipse
I'm using maven to build
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Can you post the maven pom.xml? Do you have 1.8 specified in the maven pom properties?

Something like...
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

...
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
...
</project>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
victoriaharryAuthor Commented:
Thanks, the pom still referenced 1.7. I changed it to 1.8 and it built successfully
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
You're welcome, glad that it is all sorted!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Eclipse

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.