java8 / Java8InAction

MIT License
3.18k stars 2.26k forks source link

有些方法找不到 Some method is undefined #34

Closed KitGavinx closed 3 years ago

KitGavinx commented 4 years ago

class: lambdasinaction.chap10.OperationsWithOptional line 15 and line 18 The method or(() -> {}) is undefined for the type Optional


class: lambdasinaction.chap10.OptionalMain line 21 The method flatMap(Function<? super Optional,? extends Stream<? extends R>>) in the type Stream<Optional> is not applicable for the arguments (Optional::stream)


class: lambdasinaction.chap6.Grouping line 36 The method flatMapping(( dish) -> {}, toSet()) is undefined for the type Grouping

line 41 The method filtering(( dish) -> {}, toList()) is undefined for the type Grouping


class: lambdasinaction.chap6.PartitionPrimeNumbers line 36 The method takeWhile(( i) -> {}) is undefined for the type Stream

manaatmoon commented 4 years ago

I meet the same problems. The readme.md said this project should be based on JAVA 1.8, but actually the takeWhile is a new function for JAVA 1.9, and also source and target in the pom.xml are also 1.9, so i'm a little confused which java version should i use to run this project?

xerZV commented 4 years ago

@manaatmoon I've used Java 11.

MABIY commented 4 years ago

pom.xml compile plugin source and target all 1.9 , but the project of java8.

NiceSeason commented 4 years ago

I meet the same problems ,too

DeepaAC commented 4 years ago

any solution i am also facing same problem when giving 1.8

warriorSL2016 commented 3 years ago

java11 is ok