Estou tentando acessar os recursos do Java 24. Mas não consigo acessar. Estou usando o programa abaixo
public static void main(String[] args) {
Stream.of("apple", "banana", "kiwi")
.gather((word, out) -> {
for (char ch : word.toCharArray()) {
if (Character.isLowerCase(ch)) {
out.accept(ch); // emit each lowercase letter
}
}
})
.forEach(System.out::println);
}
Mas está me dando a exceção de tempo de compilação abaixo
The method gather(Gatherer<? super String,?,R>) in the type Stream<String> is not applicable for the arguments ((<no type> word, <no type> out) -> {})
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method gather(Gatherer<? super String,?,R>) in the type Stream<String> is not applicable for the arguments ((<no type> word, <no type> out) -> {})
Lambda expression's signature does not match the signature of the functional interface method integrator()
Eu habilitei os recursos de visualização nas propriedades
Mas ainda não é possível executar recursos de visualização. Estou esquecendo de algo aqui?
Estou usando a versão mais recente do Eclipse, 2025-03, 4.35