Top 10 Java 8 Tutorials - Best of Lot, Must Read

It's almost six months since Java 8 has released and there are so many Java 8 tutorials are written by Oracle, bloggers, and other peoples, but which should you read? Which tutorials are worth of your time? Actually, this question is asked to me by one of my reader called John, he was asking me about some good Java 8 tutorials, which he can read to start with. This encouraged me to take a look at some of the the Java 8 tutorials available on the internet and form a list of best. I have just used three criterion, content, language and length. Because tutorials complement books, they should not be like the book. They should be small enough to complete in few hours and complete enough to give useful information. I also like tutorials, which discusses practical problems and examples.

One more thing which I kept in mind while choosing these tutorials is that this list of Java 8 tutorial must explain core features like lambda expressions, streamsdefault or extension methods, annotation changes in Java 8, Nashron JavaScript engine, new Date and Time API and a couple of more interesting features. I think following Java 8 tutorials have all these qualities and they are currently the best Java 8 tutorial available online.

List of Must read Java 8 Tutorials

Here is my list of Java 8 tutorials, which I will recommend to any Java programmer who wants to learn Java 8. These tutorials are good for both intermediate and experienced Java programmers, you will learn sufficient details of all key Java 8 features by following good non-trivial examples. Most of the tutorials are detailed enough to  provide all important information and good enough to engage you for that period of time. So let's first start with official Java 8 tutorials from Oracle itself.

Official Java 8 Tutorial from Oracle
Oracle has done a really good job with Java after it's acquisition from Sun Microsystem. All the worries of Java no longer to be open source and destroyed by Oracle is settled by now, and if you still have that in mind then it will surely go away after using Java 8. They have even started work with Java 9, with features like money API, modules API and several others. Coming to this tutorial, it's the first one to look, even if you don't go along with all the examples, you must first look at this and then follow some other tutorials from internet. Oracle has covered almost all important features of Java 8 e.g. lambda expressions, default methods, stream API, bulk data operations, optionals, new Date and Time API, annotation changes in Java 8 and others. This particular link is for their lambda expression tutorial, but you can find all other topics by following this link. Seems, they have just done some CSS changes in their website, which makes reading this tutorial even more pleasant experience. I really liked how they have organized the tutorial and how they take your from simple to complex concept in matter of few examples. It's one of the best Java 8 tutorial, you can get for FREE, so don't forget to fully utilize it. They even have lots of good articles about date and time, optionals and other feature which you find on Java Tech network.

Java 8 Tutorial By Benjamin Winterberg
When I first come across this tutorial, I was thinking it as "Yet Another Java 8 Tutorial" but I was wrong, it's very well written and probably better than official Java 8 tutorials from Oracle for impatient developers. It's not as detailed as official Java 8 tutorials from Oracle, but surely detailed enough to give you exposure of all key details. It's worth of all seconds you spent on this tutorial, well organized and nice and simple examples. Benjamin Winterberg has done fabulous job, Kudos to him. Along with content, presentation is also good and once you start reading you will only getting up after finishing it, not much scrolling you can do there :)

Lambda Expressions in Java 8
Dr. Dobbs is one of the respected site among developers and they often introduce new concepts with good details. This article has done justice with most important feature of Java 8, lambda expression. This will explain you the concept right from the start, as why do you need lambda expression, and if you are one who is lost between cryptic syntax of lambda expression ( I was, almost a year ago ) then this article is something you can look forward. It explains syntax of lambda expressions, how lambda do type inference, and how lambda expression works. Focus is how do you write clean code using lambdas and how functional interfaces, method reference, and constructor reference help you on your goal. It also touches tricky topic of lexical scoping used in lambda expressions along with default methods, and static methods on interfaces. If you are not convinced yet to read this tutorial, you would after knowing that author of this article is none other than Cay S. Horstmann, professor of computer science at San Jose State University, a Java Champion, and a frequent speaker at computer industry conferences and author of Java SE 8 For the Really Impatient book.

Overview of JDK 8 Support in NetBeans IDE
Out of big three Java IDEs (Eclipse, Netbeans and IntelliJ IDEA) , I think Netbeans has best support for Java 8. Their code assist and quick tips helped me a lot to master syntax of lambda expression and where I can use lambda. It can be really confusing when you find you can pass lambdas to some method but not to others, as you can only pass lambda expression to a method whose parameter is a functional interface, annotated by @functional or SAM type (a class or interface with just one abstract method). Netbeans really help here, it will suggest you when you can use lambdas, when you can use method reference, where is legal and where is illegal. So along with any of these tutorials or books, Netbeans should you be your best companion in your Java 8 journey.

My Java 8 Lambda Expression and Streams Example
What can be better than sharing your own experience and in this article I have shared Java 8 lambda expression and Streams wisdom with some easy to follow examples. This is the busy developers guide, who wants to learn by following and doing examples. You will find how you can replace your old anonymous class way of coding with brand new lambda expressions. I have given examples of how single abstract method interfaces e.g. Runnable, Comparable, Comparator, and ActionListener can benefit hugely from lambda expressions and functional interfaces. Since Java allows SAM type functional interface you can create method in Java 8 ways.

Maurice Naftalin's Lambda FAQ
This is one of the premier resource for lambda expression and Java 8. You will get answers to all your queries related to lambda expression here e.g. Why Java needs lambda expression, how Lambda expression works internally and all syntax and semantics of Java 8 lambdas. This is actually one of the most authoritative source about lambdas. If you don't know who is Maurice Naftalin, you better remember him from his excellent work on Java Generics and Collection book, one of the most recommend resources on Java Collection framework. Sooner or later you will come to this site, but since you know about it now, it's worth paying a visit and taking an idea of what you can learn about lambda expression in Java 8.

My Java 8 Streams Examples
I love stream for their expressiveness, lazy optimization and ease of code, and I found it while trying several different examples. This collection contains those tried and tested code snippet of stream API. You can find how to filter using streams, how to collect result, finding max and min, average and working with integer streams there. If you love to learn by following a different kind of how-to examples, then you will find this tutorial useful. It's more focused on how to do in Java 8 but also gives you important details while trying those examples.

Java 8 Tutorials through Katas : Berlin Clock (Easy)
Programmers loves Katas, I do, don't you? and what would have been better than learning new Java 8 concept using classical programming Katas. Viktor Farcic and Jordi Falguera has done really good job to teach Java 7 and 8 coding style using problems like Fizz Buzz, Berlin Clock, Tennis Game, Prime Factors, String Permutations, Word Wrap, Mars Rover, Bowling game and Reverse Polish Notation. Some of the Katas are in Scala which gives you more challenges of converting them into Java 8 code. So if you like to practice some programming Katas using Lambda expressions, Streams and new Java 8 utilities, this site is for you.

A deeper look into the Java 8 Date and Time API
List of Best Java 8 TuotrialsWhen someone talk about Java 8, including myself, main focus is always on lambda expression, but there are some other significant changes, which is also as important as lambdas. After lot of criticism of Java's handling of Date, Time and Calendar, Java is now sorted out all their mistakes by giving us a brand new Date and Time API. This API the is result of all experiences of how a programming language should handle critical date and time. Though API looks largely inspired from joda date and time API, it's very designed. One of the key thing the is separation of date from human and machine point of view. You have classes like Instant, Duration, LocalDate, LocalTime for your day to day needs. Java's handling of time-zones is also better in this new API,  I hope it provides some way to reduce errors due to confusing names e.g. Asia/HongKong and Asia/Hong_Kong (one of them is valid). As suggested this article provides a deeper look into Java 8 Date and Time API. It's example driven article and I am sure you will love it.

Java 8 Stream Tutorial
I have become fan of Benjamin Winterberg, after reading his Java 8 tutorial, so when he publishes next two article in this series, I was quick to read. Like his previous article, he has done justice with Streams as well. I am really how he covers the concepts one by one in an order, which looks perfect. Since there are lot of things to learn about Streams, there is good chance that one or two will be missed, but this article covers most of them e.g. different kinds of streams operations like intermediate and terminal, lazy evaluation of streams, filtering, transformation, parallel execution, special Stream classes for primitives and several others. You will not only learn basics like what is a Stream in Java 8 and How it works but also some advanced operations e.g. how to use FlatMap, using Map and Reduce function in Java 8, filtering, collecting results and so on.

Java 8 Nashorn Tutorial
This is another gem by Benjamin Winterberg and it's actually one of the rare best articles on Java 's new JavaScript engine, Nashorn. For those who don't know, Java supports execution of JavaScript code from Java 1.6 by supporting Rhino (Java's legacy JavaScript engine from Mozila). Nashron is in the same league as Google V8 (JavaScript engine of Chrome browser) and Node.js. Though I have yet to be proficient in utilizing this powerful feature of Java, I like his article. It's good to learn about JJS (Java's command line tool to execute JavaScript) but also how to execute JavaScript code from Java Class itself. If you have just started exploring this feature, this is the article you should read.

Java 8 StampedLocks vs. ReadWriteLocks and Synchronized
Takipi blog has some interesting Java 8 tutorials, one of them is Java 8 StampedLocks vs. ReadWriteLocks and Synchronized. Tal Weiss, CEO of Takipi has done great job in explaining how StampedLock fair with classical synchronized keyword and better performing alternative ReadWriteLocks. He has nicely compared performance of these three lock on the various scenario like 19 reader vs 1 writer, 16 reader vs 4 writer, 10 readers vs 10 writers and 5 readers vs 5 writers. Though conclusion is somewhat intuitive but more realistic as on average still intrinsic lock provided by synchronized keyword perform better.

Books to Refer
Btw, if you are like many programmers who like to follow a book from start to end to learn concepts in a right order and with completeness than you can take help from Java 8 in Action by Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft, which explains lambda expression, stream API and other functional features in great detail.

You can also read Java SE 8 for Impatient by Cay S. Horstmann, which explains all important features including functional and non-functional like new date and time API. In short, both are great books to learn Java 8.

Best book to learn Java8Good book to learn Java8

These were some of the best Java 8 tutorials you will find online at this moment. Though these tutorials doesn't cover all the features introduced in Java 8, You will get nice overview of most of the core features e.g. Streams, Lambdas, new Date and Time API, Repeatable annotations, Nashorn and others.

If you are hungry for more Java 8 tutorials, resources and books, You can also take a look at my earlier article about some of the best Java 8 books. I personally likes to thank all authors for taking their time and sharing knowledge, making it easy for us to understand power of Java 8. Great job guys.

P.S. : If you want to learn more about new features in Java 8 then please see the tutorial What's New in Java 8. It explains about all important features of Java 8 e.g. lambda expressions, streams, functional interfaces, Optional, new date and time API and other miscellaneous changes.


  1. The best tuotrial of Java 8 is the official one, which is , it is complete, comprehensive yet easy to understand.

  2. Instead of reading tutorial here and there, I guess just check out any good book on Java 8.

    1. Agreed, you will learn much better with a book like Java 8 in Action than these random tutorials.

  3. Can you please let me know from where I can download Java 8 books in PDF format, e.g. I want Java 8 in Action and Java 8 for Really Impatient in PDF format so that I can read them in my smartphone. Thanks

  4. Here is another list of great books to learn Java 8 in quick time

  5. All the worries of Java no longer to be open source and destroyed by Oracle is settled by now...
    How can you say this?

    1. @Devesh, just look at the progress or number of Java releases after Oracle took over Java from Sun. Java 8 is barely out in 2014 and Java 9 is coming shortly. Certainly Java is priority in Oracle's mind if not then also they are not ignoring it.

  6. Does anyone think that Python will take over Java in the future or they are already taking over?

    1. @Anonymous, Python is a great language and its already replaced Java in United states as one of the first few languages in Academics e.g. Colleges and University, but Java is just so huge, it has used all over the places, you can read my post where Java is used in real world to get an Idea. So, I don't think Python can totally replace Java but yes it can complement it.

      You can also read my opinion on Python vs Java, which language to learn first