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.
— Takipi (@takipid) May 10, 2016
The Top 20 Most Popular Java 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
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.
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.