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.

Break or return from Java 8 stream forEach?

When using external iteration over an Iterable we use break or return from enhanced for-each loop as: for (SomeObject obj : …

java foreach lambda java-8
Java 8: Difference between two LocalDateTime in multiple units

I am trying to calculate the difference between two LocalDateTime. The output needs to be of the format y years …

java date datetime java-8 difference
Removing Java 8 JDK from Mac

So I installed the beta of JDK 8 a while ago to look at some of the examples. I thought for …

java macos intellij-idea java-8
How to use a Java8 lambda to sort a stream in reverse order?

I'm using java lambda to sort a list. how can I sort it in a reverse way? I saw this …

java lambda java-8 java-stream
Is there a concise way to iterate over a stream with indices in Java 8?

Is there a concise way to iterate over a stream whilst having access to the index in the stream? String[] …

java java-8 java-stream
How to set IntelliJ IDEA Project SDK

I just installed IntelliJ IDEA and when I try to create my first Project it asks for me to set …

java intellij-idea java-8 sdk java-7
Is it possible to use Java 8 for Android development?

Searching the web, it is not clear if Java 8 is supported for Android development or not. Before I download/setup …

java android java-8 android-gradle-plugin
How to tell if JRE or JDK is installed

I have one computer that I intentionally installed JDK on. I have another computer with JRE, for, among other things, …

java macos java-8
Calculate days between two dates in Java 8

I know there are lots of questions on SO about how to get, but I want and example using new …

java java-8 java-time days date-difference
How do I define a method which takes a lambda as a parameter in Java 8?

In Java 8, methods can be created as Lambda expressions and can be passed by reference (with a little work under …

java lambda java-8