Top "Java-8" questions

Use this tag for questions specific to Java 8 which is version 8 (internal number 1.8) of the Java platform, released on 18 March 2014.

installing JDK8 on Windows XP - advapi32.dll error

I downloaded JDK8 build b121 and while trying to install I'm getting the following error: the procedure entry point RegDeleteKeyExA …

java dll java-8 windows-xp
Java 8 Streams FlatMap method example

I have been checking the upcoming Java update, namely: Java 8 or JDK 8. Yes, I am impatient, there's a lot of …

java java-8 java-stream flatmap
Modifying local variable from inside lambda

Modifying a local variable in forEach gives a compile error: Normal int ordinal = 0; for (Example s : list) { s.setOrdinal(ordinal); …

java lambda java-8
How can I throw CHECKED exceptions from inside Java 8 streams?

How can I throw CHECKED exceptions from inside Java 8 streams/lambdas? In other words, I want to make code like …

java lambda java-8 java-stream checked-exceptions
How to convert ZonedDateTime to Date?

I am trying to set a server agnostic date time in my database and I believe the best practice to …

java java-8 java.util.date datetime-conversion zoneddatetime
Java 8 method references: provide a Supplier capable of supplying a parameterized result

I'd like to use java.util.Optional.orElseThrow() with an Exception type that asks for a constructor parameter. Something like …

java java-8 java-stream
Format LocalDateTime with Timezone in Java8

I have the this simple code: DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss.SSSSSS Z"); LocalDateTime.now().format(FORMATTER) …

java java-8 java-time
How to extract epoch from LocalDate and LocalDateTime?

How do I extract the epoch value to Long from instances of LocalDateTime or LocalDate? I've tried the following, but …

java time java-8 epoch java-time
How to use the unsigned Integer in Java 8 and Java 9?

In the Oracle "Primitive data types" page, it mentions that Java 8 adds support for unsigned ints and longs: int: By …

java java-8 unsigned
Adding two Java 8 streams, or an extra element to a stream

I can add streams or extra elements, like this: Stream stream = Stream.concat(stream1, Stream.concat(stream2, Stream.of(element)); …

java concat java-8 java-stream