Who’s on top and who’s left behind? We analyzed 47,251 dependencies on Github and pulled out the top 100 Java libraries

Our favorite pastime for long weekends is to go through Github and search for popular Java libraries. We decided to share the fun and the information with you.

We analyzed 47,251 import statements of 12,059 unique Java libraries that are used by the top 3,862 Java projects on Github. From that list we extracted the top 100, and now we’re sharing the results. Cue the drum roll.

The Top 20 Most Popular Java Libraries

Top 20 Libraries

Holding the crown from last year, junit is the most popular Java library on Github. While the Java logging API slf4j reached second place, log4j reached the fourth place.

A rising trend in the list is Google’s open-source Guava, that reached third place. It contains a range of core Java libraries that were born internally at Google. If you’re not familiar with Guava or if you’re not sure how to use it, you can read our post about some of the lesser known features of Google Guava that every developer should know.

The Rise of Spring Libraries

The Spring framework became popular in the Java community as a main competitor to Java EE, and this popularity is also reflected in Github; out of the 100 most popular libraries, 15 are Spring related. The most interesting part here is the meteoric rise of Spring Boot, that allows developers to create Spring-powered applications and services with minimum boilerplate. Do you want to get a production ready Java application off the ground in the shortest time possible? Check out our post about Java Bootstrap: Dropwizard vs. Spring Boot.

Top Spring Libraries

#13 – springframework.spring-context
#17 – springframework.spring-test
#22 – springframework.spring-webmvc
#24 – springframework.spring-core
#27 – springframework.spring-web
#36 – springframework.spring-jdbc
#37 – springframework.spring-orm
#38 – springframework.spring-tx
#40 – springframework.spring-aop
#47 – springframework.spring-context-support
#72 – springframework.boot.spring-boot-starter-web
#81 – springframework.security.spring-security-web
#82 – springframework.security.spring-security-config
#88 – springframework.boot.spring-boot-starter-test
#99 – springframework.security.spring-security-core

The Most Popular JSON Libraries

Since Java doesn’t have native support for JSON (although it almost made it into Java 9!), we wanted to see how popular these libraries are among Github projects.

You shouldn’t judge a library by its cover. Not all JSON libraries perform the same, and picking the right one for your environment can be critical. If you want to know which one you should use, check out our latest JSON benchmark.

The Top JSON Libraries Are…

#14 – fasterxml.jackson.core.jackson-databind
#19 – google.code.gson.gson
#43 – json.json
#80 – googlecode.json-simple.json-simple
#89 – thoughtworks.xstream.xstream

The Fantastic 4 (That’s Worth Mentioning)

There are plenty of interesting and even new libraries that caught our attention, but we decided to focus on these 4:

#68 – projectlombok.lombok – This project aims to reduce boilerplate in Java, replacing some of the worst offenders with a simple set of annotations.

#90 – jsoup.jsoup – A Java library for working with real-world HTML. It provides an API for extracting and manipulating data using DOM manipulation, CSS and jquery-like methods.

#92 – io.netty.netty-all – A network application framework for quick and easy development of maintainable high performance protocol servers & clients.

#98 – dom4j.dom4j – Open source framework for processing XML. It’s integrated with XPath and offers full support for DOM, JAXP and Java platform.

Top 100 Libraries by Type

Top Types

The Math Behind the Magic (or: How Did We Come Up With Our List)

You’re probably asking yourself how did we get this information. We first pulled out the top Java projects from Github by their ratings. We took that data and extracted the projects who use Maven or Ivy for dependency management to gain quick access to their pom.xml / ivy.xml dependencies, this left us with 47,251 data points.

We did some mad crunching and analyzing, which left us with 12,059 unique Java libraries that are used by the top 3,862 Java projects on Github. From there it was easy to get the top 100 libraries, based on the number of Github projects they appear in.

If you want to look into our raw data, the file is available here. Although we were sober this time around, you’re still welcome to take a look and make sure we didn’t miss any interesting insight.

Final Thoughts

When we compare our current Top 100 list vs last year’s results, we can detect some movements among smaller libraries, with an rising interest in Spring and the depart of MongoDB.

However, when looking at the majority of Java developers they’re pretty consistent when it comes to their choice of Github libraries. It’s not a big surprise, considering the amount of existing projects using these libraries that will keep on using them through 2017 and beyond.

If you already have your choice of libraries but you’re still looking for the ultimate tools, we have the perfect advice for you. Check out The Top 15 Tools Java Developers Use After Major Releases.

I write about Java, Scala and everything in between. Lover of gadgets, apps, technology and tea.
  • Brooke Smith

    Have you thought about incorporting information from Maven Repositories? Might provide better insights.

    • Henn Idan

      Hey Brooke, thanks for your reply. This year we decided to focus only on Github projects, but we’ll consider including Maven Central in one of our next posts 🙂

  • Omri

    In your conclusion, what did you mean by “the depart of MongoDB”? You do not mention mongodb anywhere else in the post…

  • Emmanuel Bourg

    commons-lang and commons-lang3 should be merged when ranking the libraries, that’s the same project.

  • Jacek Jackowiak

    Nowadays Gradle is probably more popular then ivy so it would be nice to support it also

  • Gunnar Morling

    These numbers are very interesting (thanks for doing this analysis), but I’m not sure whether that’s the best approach for finding “the most popular Java libraries”.

    What you get is “libraries most popular with authors of other libraries”, as libraries are what you naturally find on GitHub. In contrast, the number of actual applications on GitHub is very low, as those are typically developed in-house (and exceed the amount of OSS code by long). To get the full picture on the most popular libs overall, one would have to consider these, too, which likely is much harder.

    Analyzing download stats on Maven Central may be one approach. I’d expect numbers too look a bit different there. E.g. Hibernate (which I’m contributing to) is used in many, any business applications, but authors of other libs don’t have such a strong need for it as for e.g. JUnit.

  • John D. Ament

    Just want to make sure I understand properly. You went through 3.8k github repos, and picked out the top 100 most commonly used frameworks in those repos, based on the import statements in use? Did you exclude these libraries from those checks as well?

  • Farley Lai

    Still no great plot/graph libraries that is at least comparable to Matplotlib?

  • https://monstertut.com/udemy-coupon-and-discount-code/ monsterTUT

    I really like the Spring Framework. Anyone tried Spring Boot too?