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.

How can I get a List from some class properties with Java 8 Stream?

I have a List<Person>. I need to get a List from a property of Person. For example, …

java collections java-8 java-stream
Java 8: How do I work with exception throwing methods in streams?

Suppose I have a class and a method class A { void foo() throws Exception() { ... } } Now I would like to call …

java java-8 unhandled-exception java-stream
Why should Java 8's Optional not be used in arguments

I've read on many Web sites Optional should be used as a return type only, and not used in method …

java java-8 optional
WebService Client Generation Error with JDK8

I need to consume a web service in my project. I use NetBeans so I right-clicked on my project and …

webservice-client java-8 netbeans-8
Java 8 - Best way to transform a list: map or foreach?

I have a list myListToParse where I want to filter the elements and apply a method on each element, and …

java java-8 java-stream
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15

I'm porting a webapp from Tomcat 7 to another server with Tomcat 7 but with Java 8. Tomcat starts successfully but in log …

java eclipse tomcat java-8 classformatexception
How to convert an Instant to a date format?

I can convert a java.util.Date to a java.time.Instant (Java 8 and later) this way: Calendar cal = Calendar.…

java date datetime java-8 simpledateformat
Using Java 8's Optional with Stream::flatMap

The new Java 8 stream framework and friends make for some very concise java code, but I have come across a …

java lambda java-8 java-stream
Java 8, Streams to find the duplicate elements

I am trying to list out duplicate elements in the integer list say for eg, List<Integer> numbers = …

java lambda java-8 java-stream
How to compare LocalDate instances Java 8

I am writing an app that needs to be quite accurate in dates and I wonder how can I compare …

date compare java-8