It started as a morning debate among the team while waiting for the coffee machine to power on: Could anyone name the most popular library used by Java Developers? We had a few guesses (side note: why does our coffee machine need so much time to get itself ready in the morning?), but to our shock and horror, none of us got it right. We did the same thing again recently and got the right answer (phew!), but realized it was time to update this list.
So before going any further, make your guess for the most popular Java library now!
Ready? Then let’s have a look at the top 10 libraries (as defined by downloads from the Maven Central repo in February 2023):
10. Kotlin Stdlib Common (new entry)
Kotlin is a statically typed JVM (Java Virtual Machine) language that has a clear, easy to read syntax, that is interoperable with Java. Kotlin Standard Library provides the essential higher-order and extension functions required for everyday work.
9. Apache Commons IO (down from #7)
Commons IO by Apache is a set of utilities to help with IO from your application. Particularly when working with Files, there are a number of features in Commons IO that make your life as a developer much easier.
8. Logback Classic Module (no move)
Logback is a newer logging framework than log4j and their website states they are offering enhancements over log4j.
7. Jackson Databind (new entry)
Jackson is an Open Source JSON processing library, used for converting JSON into POJO or vice versa, increasing code reliability and making it more efficient in terms of developer time.
6. Apache Commons Lang (new entry)
The Apache Commons libraries are one of the most popular third-party libraries. Commons Lang supplies extra helper methods to manipulate Java core classes to make a developers job simpler.
5. Mockito Core (up from #6)
Mockito is a mocking framework. Used during unit testing, this will allow you to not spin up an entire environment for your testing.
4. Scala Library (down from #3)
Scala is a programming language that combines object oriented and functional programming into a single language. Scala is popular in the big data circles, and given the rise of big data over recent years, I am not surprised to see Scala on this list.
3. Guava: Google Core Libraries For Java (up from #4)
Guava, like Apache’s Commons, is a set of utilities for making your life as a developer easier. Guava covers all the tools that Google’s Java developers rely on in a single library.
2. SLF4J API Module (no move)
Simple Logging Facade for Java is an abstraction of popular logging frameworks including the two earlier in this list. This allows you to choose your logging framework at deployment time rather than during your development.
1. JUnit (no move)
And of course, JUnit is at number one – still don’t know why I didn’t guess that last time! I am sure many of us add JUnit to our projects without thinking. Who’s going to write code without producing tests? (If this describes you, there are tools out there that can write your tests for you).
Interesting absences
There are a few other surprises for me in this list. First, looking at the overall makeup, seven out of the top ten are general libraries which don’t add much new functionality – essentially, these libraries extend or improve on components of the JDK. I will admit it: I was thinking that the likes of Spring would be close to the top of the list.
Initially thinking about the popularity of mobile devices, I was wondering why aren’t there more Android related libraries in the list. But here, we are suffering from lies, damn lies and statistics. Google hosts their own maven repo with Android dependencies, so I assume most Android developers get their libraries directly from Google.
Out of the household names in this list, Apache appears the most. If I had been asked, I would have thought of Google before Apache for popular open source authors. Interestingly, however, I expected Apache Commons to appear above Guava. I suspect that Apache Commons suffers here from being split into multiple libraries. If we take all Apache Commons libraries the total uses exceed that of Guava.
So there you have it! How accurate were your guesses? Share your guesses with us @DiffblueHQ on Twitter. And if your #1 guess was better than mine because you’re already writing unit tests, why not take a look at how AI can do a lot of that work for you?