Explore the JDK 8 API

The Mars Rover was sent to space to discover the surface of the mars. Now YOU are sent out to the JDK 1.8 API to discover all the new classes and hidden gems. But before starting your journey make sure you’re familiar with the most recent changes in Java 8 by reading my Java 8 Tutorial and my Java 8 Nashorn Javascript Tutorial.

In order to find all the new stuff in JDK8 I wrote a tool called the Java 8 API Explorer.

Java SE 8 API Explorer

The Java 8 API Explorer is a single page including all newly added features from the latest Java release. You can search all class files with at least one new member marked via since 1.8. New files are tagged as NEW. The indicator on the right side describes how many new members are contained in this file.

Click on any class in the search result to open the detail view for this class file. The detail view contains declarations for all new methods, fields and constructors as well as direct links to the official Javadoc. So you can deep dive right into everything of your interest.

Number crunching

A few statistics.

  • 195 new files were added to the JDK8 API (4240 total files now)
  • 93 new classes, 89 new interfaces and 13 new enums
  • 2699 new methods, 56 new constructors and 49 new fields
  • 46 interfaces are marked as functional
  • 213 default interface methods
  • 68 static interface methods

About making the tool

The project is written in Java 8 and hosted on GitHub. I use Jsoup both for parsing the original Javadoc and creating the single HTML page. It’s my favorite tool for working with HTML because the API is very clear and well thought. Selecting elements with Jsoup is straight forward if you’re familiar with CSS or JQuery Selectors.

Document document = Jsoup.parse(file, "UTF-8");
Element body = document.body();
String packageName = body
    .select(".header > .subTitle")

Feel free to fork the code and find out more about Jsoup and the making of Java 8 API Explorer. If you have any questions or want to share your findings with me, don’t hesitate to contact me.

If you want to learn more about Java 8 feel free to read my Java 8 Tutorial and my Java 8 Stream Tutorial.

Have fun!

Read More