Stack OverflowMost useful free third-party Java libraries
[+413] [183] Pyrolistical
[2008-09-24 21:29:01]
[ java libraries freeware ]

My world is without a good list of free Java libraries. What are some of your can't-live-without Java libraries?

Note: To keep this as useful as possible, please remember:

Consider highlighting or moving some of these libraries into the Java tag wiki [1].

Well, I wasn't actually trying to create a poll, perhaps my "question" is poorly chosen. What I really wanted to do is allow everybody to learn what good Java libraries are out there. - Pyrolistical
(2) The problem with putting your answer in the question itself is that people can't vote on it. You could have a really interesting question but poor answers. In that case, I would want to vote the question up but the answer down but I won't be able to. - Outlaw Programmer
I suggest that in a few days you update the question to contain a list of the libraries suggested below (for instance, ordered by number of votes). - jan.vdbergh
XmlBeans? Deprecated and limited. JAXB is bundeled with JDK since Java 5. - ivan_ivanovich_ivanoff
@ivan, perhaps you should add that comment here:… - Jonik
You cannot list Guice as the first and only DI framework. Spring is far more popular. True, Spring has an MVC extension, but, at its' core, Spring is a DI framework and should be listed as such, before Guice. - zvikico
Yeah. Such problems arise with this kind of simple categorisation. I think we should either 1) throw away the whole "Summary of the answers" altogether or 2) change it into a simple Top-n list of libraries (Top 25 or so?), without the doomed-to-fail attempt to categorise them. Any opinions? - Jonik
(3) Since no-one seems to have opinions, I'll just be bold (like they say in Wikipedia) and remove the Summary as it stands now. (If someone wans to re-add it, please consider other options than a categorised list.) - Jonik
Maybe we should divide questions to frameworks, common libraries etc ? - Peter Gwiazda
Maybe. But I predict categorisation would be difficult in such division too. (What kind of frameworks? How to draw a line between "framework" and "normal library", at least so that everyone agrees about it?) Actually I seriously doubt dividing this would work at all. But of course new, more specific questions in addition to this one might be useful. - Jonik
This is a perfect example of an aged question: Some of the answers are obviously out of date (libraries not maintained anymore, features included in never versions of Java). - Martin Schröder
[+278] [2008-09-24 21:30:29] Konrad

Apache Commons. Nuff said.

Commons are so useful. Commons-libraries are used by most of my projects. - Mnementh
I can't think of a single app that I currently work with that does not have at least one dependency to a commons project. - Konrad
I (heart) Apache Commons - Stu Thompson
(23) It's actually really annoying to see code with custom utility methods/classes that try to do the same thing as commons classes but do it badly. - Michael Rutherfurd
(24) I think commons logging is seriously annoying. It provides nothing useful over log4j. Neither are part of the JDK so they're equally portable. Commons logging just replaces one dependency with another. And it makes logging harder to configure. - Draemon
+1 I have just recently started using a couple of the different Apache commons libraries, they are really well made and well documented. Definitely some of the best around. - Mark Davidson
(6) Take a look at the "Fast" collection classes in Commons-Collections. What a pile of utter, utter rubbish. - oxbow_lakes
(1) Commons made Java life easier... - Ravi Wallau
(78) Commons is 50% useful stuff and 50% utter crap. - foljs
(1) @foljs luckily you can pick which 50% you use. - TM.
(1) That 50% is really awesome, the other crap is useful sometimes and those times becomes diamonds - victor hugo
(34) Many of the apache-commons APIs have outdated concepts, the APIs are badly maintained. It's Sad. - ivan_ivanovich_ivanoff
(2) @Draemon, we use the slf4j replacement for commons logging to get into slf4j-api. Very useful! - Thorbjørn Ravn Andersen
Please split this so I can downvote commons-collections and upvote commons-math and commons-csv - finnw
@finnw, fan of guava ? - Gepsens
It's very unfortunate that knowledge of Apache Commons is not included in standard Java certificates. It's one of things that makes them over-theoretical and not very useful. - lechlukasz
[+247] [2008-09-25 11:08:39] bernardn

Let's not forget the excellent Google Collections [1] library. (Edit: Google Collections was expanded and renamed to Guava [2]. You should not use the library titled "Google Collections" anymore.)

Javalobby's interview with its main developers is a good introduction: What is the Google Collections Library? [3]

Comments by Steve McLeod [4]:
It's gradually altering my whole coding style. Preconditions, Functions, Transformers are stupendous once you get the hang of them.


(13) +1. Google Collections seems like the best possible extension to the Java Collections framework one could imagine. The API and its documentation are of high-quality; the library is built to fully utilise Java 5 features (generics, enums, etc); it's been designed by really smart people who've had the possibility to turn to people like Joshua Bloch and Doug Lea for consultation. Read the Javalobby article if you haven't yet! - Jonik
(3) In addition to the Javalobby interview, a good resource for getting to know Google Collections is Kevin Bourrillion's presentation, available on Youtube: part 1:; part 2: It's a tour of the library and its main APIs on a quite technical level. The guy expresses himself very clearly! - Jonik
I understand why they use static 'create' methods instead of ctors. I just don't like it. - KitsuneYMG
(2) @Jonik, thanks for this, particularly the link which leads to the other link great stuff. - Yar
(5) Google Collections has been rolled in to Guava Libraries, which has support for primitivies, IO and concurrency among other things (though some parts are Beta and subject to change). Just makes a good thing even better. - ColinD
Guava libraries (r06 now) can replace some apache commons - collections, io etc. - Peter Gwiazda
Guava-equivalents to apache collections methods:… - Ray
[+190] [2008-09-24 21:39:26] Mike Deck

Joda Time [1] is an absolute must if you're doing anything beyond the most trivial of date computations.

Note: JSR 310 [2] aims to fix a lot of the problems with the standard Java Date and Time API.


(3) Couldn't agree more - SCdF
+1. Might not be needed?? Unless JSR 310 makes my coffee for me I am not changing! - WolfmanDragon
(3) I haven't looked at it in depth, but I was under the impression that the proposed API would borrow heavily from the Joda Time project. I believe all of the value objects will be immutable and the primary domain concepts they are modeling look to be quite similar to those in Joda Time. Also, Stephen Colebourne, the project lead from Joda Time is one of the leads on the JSR 310 project as well. If/when this JSR is added to the public release the Joda Time project will likely die off or become radically transformed, and the new API will essentially be what Joda Time 2.0 would have been. - Mike Deck
(3) JSR 310 has slipped Java 7. Let's hope it's in Java 8. There won't be a strong reason to change to it if you're already happy using Joda-Time. However, libraries would be able to use it, even using its types in their APIs, without foisting the Joda dependency on all their users. - Kevin Bourrillion
[+153] [2008-09-24 21:36:31] Mnementh

Apache Log4j [1] is a well-known logging-library.


only if not used in concurrent environment. otherwise, can cause deadlocks - Boris Pavlović
I don't believe this is true. I've used log4j in a highly concurrent environment, for many years, with no deadlocks. - Eddie
(3) It may depend on what appenders you use, some web sites <cough>stackoverflow</cough> have been known to use database appenders. (Log4net as well). I have never had concurrency issues with log4j used in high volume sites. - David Waters
Log4j configuration is horrible though, but thankfully it mixes very nicely with slf4j. - Esko
(1) Having had close contact with log4j code, I must say that it is rather horrible. And horribly synchronized.. basically sad we're stuck with it as a de facto standard. - Boris Terzic
(7) Try Logback or Logback+SLF4j. It includes a log4j-over-slf4j library. - KitsuneYMG
(3) I prefer logback + slf4j over log4j - Peter Gwiazda
[+146] [2008-09-24 21:42:03] Atanas Korchev

Didn't came the xUnit-stuff from the smalltalk-community? - Mnementh
You are absolutely right! This wikipedia entry says it all: - Atanas Korchev
(21) I'd have put them in two separate answers so that they can be voted on separately - Joachim Sauer
(3) +1 for hibernate. Can't live without it - Shervin
Hibernate is rather a framework - Peter Gwiazda
Is it possible remove this answer? Are two answers in one :) - angelcervera
[+146] [2008-09-24 21:54:44] MidnightGun

Spring [1], used for MVC (Model-View-Controller) projects


(38) Spring is good for a LOT more than MVC projects. - John Meagher
I'll second that. It is easy to pick and choose what you want to use in Spring. - Stu Thompson
That's what I used it for... anyone with more knowledge is free to edit it for greater clarity. - MidnightGun
(9) That's more of a framework than a development library... - Zombies
Spring IOP, AOP, etc. Spring is just beautiful. - Richard Clayton
@Zombies What's the difference - Nachiket
(2) Actually, this really should be split apart -- saying Spring is almost likey saying "Apache Jakarta" or "stuff from googlecode", too generic to help. I liked Spring DI, for example, and found Spring MVC not very impressing. Others have other faves. - StaxMan
-1 I can live without. - mschonaker
Spring adds good structure + makes it easy for your big application to use other frameworks/databases, and easy to switch to alternative solutions (databases, messaging systems, and more) - Thor Hovden
[+120] [2008-09-24 23:12:02] CR.

Lucene [1] for full text searches without a database.


Lucene is actually a database engine specialized for tokenized text searches :) - Esko
We used lucene as a client side Object store. we didn't need any of the tokenized searching it provides but just found it the most efficient way to persist and retrieve large amount of java objects. It even proved quicker than a HSQL implementation we tried. - Alb
I think Lucene has to be the best open source/3rd party library available keeping in mind the extremely high complexity of it's source code yet it's so simple to use it's API and it's damn powerful to use (millions of documents are indexed and retrieved at lighting fast speed) - Tarun Sapra
[+105] [2008-09-25 20:33:14] djsadinoff

JfreeChart [1] is the best freely available charting thing available on any platform.


A lightweight "cloud computing" alternative to jfreechart is charts4j ( - Julien Chastang
(1) The JFreeChart API could be much cleaner (my colleagues tell me), and they have managed to break backwards compatibility from time to time. But indeed, you can do nice charts with it - no other free Java library comes close, as far as I know. - Jonik
(1) @Jonik: +1 to your comment... We use JFreeChart a lot and it's actually quite a crappy and mega-bloated API. It's only real strong selling point is that it is selling for $0 (if you don't count the fact that the authors makes a living selling overpriced documentation). Basically, for quickly uploading data that comes in volume, JFreeCharts simply doesn't cut it. - SyntaxT3rr0r
(3) matplotlib ( ) is superior for two reasons: 1) the plots are just better 2) documentation is 100% free and verbose - Mike Lyons
(1) matplotlib looks pretty good too. Thanks for the heads-up, Mike. - djsadinoff
[+104] [2009-04-13 23:27:11] StaxMan

SLF4J [1]

Surprisingly, this good facade lib for logging (better than commons logging) was still missing.


If you added these in separate answers, they could be voted on individually... By the way, JAXB was mentioned already. - Jonik
True, sorry about JAXB, only noticed it after adding (I'll edit it away). Thanks for suggestion! - StaxMan
I've voted up Logback, I'll vote this too (simply because people won't know they're the same thing) - Stephen
(2) SLF4J is a facade, Logback is a native implementation of it. - Ivan Dubrov
[+103] [2008-09-25 14:28:41] user18596

Mockito [1] for easy testing. Allows mocking concrete classes (besides interfaces, of course) as well.

I've written unit tests for years, but Mockito and Easymock impressed me immediately.


(8) +1 for Mockito! Unlike Easymock, it was quick for me to "grok", and it actually made tests simpler and easier to understand - Jonik
Throw in PowerMock for the cases Mockito can't cover. - Omer van Kloeten
[+99] [2008-09-24 21:30:42] cagcowboy

iText for pdf creation. Couldn't live without it.

iText is a lov level API. You can also use JasperReports or BIRT - m_pGladiator
(8) Why do people say couldn't live without it?? I'm pretty sure you would live just fine - Shervin
[+88] [2008-09-24 22:32:57] Pyrolistical

Name: XStream


Purpose: Out of the box POJO serialization to XML and back again

(3) XStream is a great library, makes generating and reading XML a breeze - festerwim
[+79] [2008-09-24 22:32:24] Pyrolistical

Name: Guice


Purpose: Dependency Injection, ease of testing

(2) I've been using this for 6 months now and I'm so happy I gave it a try! It's awesome! - Mark Renouf
(4) Guice is much less flexible and more invasive than Spring. I've used it for some time, struggling with its limitations, before switching to Spring. - Shooshpanchick
[+79] [2010-11-10 21:17:27] BalusC

For HTML parsing, my big favourite is Jsoup [1]. Its biggest power is support for jQuery-like CSS selectors [2] to select HTML elements of interest.

Here's a kickoff example which summarizes links to all useful free third party libraries of the 1st page of this question.

Document document = Jsoup.connect("").get();
Elements links ="#answers .post-text a");

for (Element link : links) {


Extraordinary simple, isn't it? See also Pros and cons of leading HTML parsers in Java [3].


(17) Pretty nice example! - Jonik
(3) I've been using JSoup for over a month in a recent project and it really is a great API. Its simple when your needs are simple, but scales up nicely to more complicated problems. The fact that it is very similar to the JQuery Javascript library, and aims to provide similar functionality, is particularly nice. In short, it is a wonderful example of a modern Java library. - sanity
[+75] [2008-09-25 23:55:55] Greg Mattes

Name: The Legion of the Bouncy Castle


Purpose: Security/Cryptography

(7) Do people really trust a product named "Bouncy Castle" for important security-related things? - Adrian Petrescu
(12) Google does. BC is the default on Android, I believe. - InverseFalcon
(1) @Adrian Petrescu, it's a shame, but people do judge software products (even those not aimed at end-users) by their names. Subversion suffered badly from this. - finnw
didn't bouncy castle once have a fips certificate? uhm. close: - Ralf
[+60] [2008-09-24 22:34:31] Pyrolistical

Name: Miglayout


Purpose: A powerful layout manager that just works

Kinda of like GridBagLayout except that Miglayout you need to memorise all the strings 'commands' as the IDE wont remind you? - willcodejavaforfood
(3) MigLayout can do much more in higher precision. You can use the API too, not just Strings, and the ease of use of the API puts the ugly GridBagLayout API to shame. - haffax
@willcodejavaforfood: not like the GridBagLayout. Although you are totally dependent on the docs -- your IDE won't autocomplete the strings -- for 90% of uses MigLayout is easier than GridBagLayout. - Yar
Never really thought GridBagLayout is hard to be honest. You kids just need to be spoon fed! :P - willcodejavaforfood
FWIW, the problem with GridBagLayout for me was always that it tended to degrade poorly when it couldn't size things how it wanted. This became an issue for me when I demoed an application that naturally wanted a 1024×768 screen across a bunch of machines with 800×600 displays… I don't do GUI programs in Java any more (I tell someone else to do it for me). - Donal Fellows
[+55] [2009-02-22 07:57:11] sarav

GWT [1] - If your Javascript skills are not adequate enough for stunning AJAX applications


(1) Wow only 6 votes for Google Web Toolkit ?. it's one of the best Java frameworks and should surely be able to beat old-timers like log4j (which is not even that nice compared to say slf4j) - Lars Tackmann
Gwt is wonderful. - Ed Pichler
[+53] [2008-09-25 00:26:41] Cristiano Sanchez

easymock [1] for mock objects in unit tests.


Why not just use anonymous classes and assert parameters and return appropriate values. - mP.
EasyMock is absolutely great, mind-shaking... One can't understand it's power without trying it... - dma_k
[+50] [2008-09-24 21:30:31] Bob King

SWT [1], though I haven't used it for a while. It yeilds pretty great user interfaces.


(6) IMHO it yields the best GUI's in the Java world without using non-java frameworks like GTK or Qt - Ubersoldat
Agreed and add jface on top of SWT and you've got some nice high-level UI Components like trees and tables also. - Alb
(1) SWT uses non-Java frameworks under the hood. That's why it looks so good on so many platforms. - Donal Fellows
[+45] [2008-09-25 08:55:16] Nrj

Guess you all missed Apache POI for interaction with MS Excel !

[+42] [2009-01-25 22:01:58] Jonik

Selenium [1] - automated UI testing (or acceptance testing) framework for web applications. Getting up to speed and making your tests stable enough for fully automated continuous integration probably won't be easy, but once you do, it's quite cool what you can do with Selenium.

In case you're totally new to this, here's a summary: You can write test cases in pure Java, JUnit-style, and when you run them, Selenium launches e.g. Firefox and does all kinds of stuff (clicks on links, types into forms, does assertions about page content, etc.) against your webapp. (This is just one way of using Selenium - you can also record tests with Selenium IDE [2], or use other languages such as Python or C# to write them.)


(2) Is this a java library? - Shervin
@Shervin. Well, Selenium is a testing framework and Selenium-RC provides a Java interface to using it. Of course, distinction between a library and just a tool isn't very clear cut. But we do have stuff like JUnit, TestNG and Mockito listed here, so why not Selenium? - Jonik
True. Good point. - Shervin
[+42] [2009-01-25 22:14:44] Elijah

LogBack [1] for logging. After using logback, log4j seems antiquated.


(3) A major drawback of using LogBack is that it does not provide an asynchronous appender. There are a couple contribs in their JIRA, but you have to build them yourself. This makes using LogBack in production a no-go for a lot of folks. - Paul Morie
[+39] [2008-11-21 10:42:59] community_owned

AspectJ [1] - a seamless aspect-oriented extension to the Javatm programming language.

Very useful for logging, debugging, testing and more.


AspectJ is just awesome. Specially the Load-Time-Weaving feature, that allows embedding aspects without recompiling your application - Camilo Díaz
(2) I wish I could vote this up more than once. People really, really, really have to stop littering code with logging statements. - Dave Jarvis
ASpectJ is incredible! High productivity for some tasks. - Ed Pichler
[+38] [2008-09-25 20:33:24] Mike Cornell


It was mightily useful in creating a database driven web testing framework some years ago. JUnit was too rigid at the time to do what I needed.

TestNG is still slightly better than Junit 4. More granular test plan strategies. - Spencer K
[+37] [2008-09-24 21:30:59] pkaeding

Name: JDOM


Purpose: XML DOM manipulation

[+35] [2008-09-25 01:30:24] David Crow

These two are excellent:

Apache MINA [1] - Well-designed, high-performance, network application framework using Java NIO

Jetty [2] - Easy-to-use, full-featured, embeddable web server and webapp container


(1) I use Jetty all the time. - Mnementh
Jetty +1 Mina ? - crowne
Please list just one library per answer as the question states. - mcherm
[+32] [2008-09-24 22:33:57] Pyrolistical

Name: SwingLabs


Purpose: Extensions to Swing

SwingLabs actually has several libraries other than swingx. JXLayer and swing-ws come to mind - KitsuneYMG
[+31] [2008-09-25 17:53:58] Tom De Leu
  • JUnit [1] for unit testing
  • Tomcat [2] or Jetty [3] as servlet container
  • Spring [4] for configuration and glueing code together
  • Hibernate [5] for object persistence
  • C3P0 [6] for database connection pooling
  • Lucene [7] for fulltext search
  • Log4J [8] for logging
  • Apache Commons [9] for a whole bunch of stuff: language utilities (see StringUtils), special collections, IO, file uploads, validation, etc.
  • POI [10] for reading/writing MS Office file formats
  • PDFBox [11] for manipulating PDFs
  • Velocity [12] for templating

These are all libraries I use or have used and can definitely recommend.


(24) If you create a separate post for each suggestion they can be rated individually:-) - johnstok
(13) Yeah, now it's impossible to tell which of the 26 votes are meant e.g. for Hibernate and which for Velocity. I think this should be split into separate answers (well, those libs that don't have a separate post yet), or failing that, voted down. - Jonik
(21) -1 split them. That's part of the question. - mschonaker
I would choose Freemarker over velocity. Same basic design, but a little more robust and better supported IMHO. - BillMan
[+24] [2008-09-24 21:41:30] Rui Vieira

I'm quite partial to

JasperReports [1] - report generation libraries

prefuse [2] - visualization toolkit


(2) I've used JasperReports extensively. The API could use more comments, but the combination of iReport and JasperReports is not to be missed. - Dave Jarvis
100% for Prefuse! - H-H
(3) Two separate posts please so that they can be voted on individually - mattburns
[+23] [2008-09-24 21:37:17] Kyle Burton

Actually not just the commons, but all of Apache Jakarta [1] project has great Java libraries. From MS Office file access to collection utilities to byte code manipulation. The page also lists projects that have moved out of Jakarta (eg: maven).

Another place is [2] - several of my colleagues use that combination of tags (language + library) to organize the things they run across ( mortis [3], robdimarco [4]).


Please list just one library per answer as the question states. - mcherm
[+22] [2010-11-10 20:14:03] Jonik

Gson [1] for producing and parsing JSON.

After one day's experience with Gson, I'm pretty convinced it is the JSON library for Java that I'll be using from now on. Like other libs from Google, this seems to be high quality stuff. Check out the very good user guide [2] to get started!


Definitely a plus! - BalusC
(1) There's a great introductory-level tutorial which uses Gson: "Getting Java, C# and Perl to speak the same language (with JSON)" by Andrew Stellman… @Jonik Thanks - I fixed the link. - S.Jones
I would also consider Jackson for Java/JSON integration. It works with JAXB annotations. - BillMan
[+21] [2008-09-24 22:33:29] Pyrolistical

Name: Glazed list


Purpose: Data flow, instead of logic flow. Data centric. Works well with Swing

(3) this description doesn't quite do GlazedLists justice - the basic idea is to add event handling to the java.util.List interface. This allows for some amazingly elegant software design if you are doing anything that is list based. - Kevin Day
The screencast was very informative -… . I can't wait to use this project. I've tried to do this sort of sorting before manually and it was a pain. Great idea for a library - I82Much
I love GlazedLists, it makes swing development a LOT easier if you need to put stuff in lists or tables (and who does not?). - festerwim
[+20] [2008-09-25 09:55:11] Bill Michell

Saxon [1], for XSLT 2.0 processing (and other handy XML stuff)


That's Saxon, not xalan. Although the link is good :) - Cristian Vat
[+20] [2008-10-22 07:41:15] Jeroen van Bergen

FreeMarker [1] for templates.


[+20] [2009-05-12 17:53:38] community_owned

Ibatis [1] for ORM.

[1] - Chadwick
hibernate > ibtais. - ripper234
ibatis ==> Mybatis. - Basil Bourque
[+18] [2008-09-25 13:03:38] insin

The JGoodies Forms framework [1], featuring the excellent (and most importantly, sane) FormLayout layout manager for Swing.


[+17] [2008-09-24 22:09:50] Clue Less

JAI [1] - Java Advanced Imaging API it's very useful to do powerful image manipulation. Here comes Sun's description of it:

The Java Advanced Imaging API (JAI) provides a set of object-oriented interfaces that supports a simple, high-level programming model which allows images to be manipulated easily in Java applications and applets. JAI goes beyond the functionality of traditional imaging APIs to provide a high-performance, platform-independent, extensible image processing framework.

I would also recommend JAI-Image-IO [2] Tools.


(1) JAI is the best solution for what it does, however it's one of the less programmer-friendly APIs I've used. :( - Domchi
Unfortunately I have to agree with Domchi. I wonder why Java just have to over engineer everything. - nimcap
[+16] [2008-11-11 19:37:35] Ed Brannin

Log5j [1] is a wrapper around Log4j that uses Java 5's var-args for an automatic String.format in log messages:

log.debug("IOException while reading %s", exception, file.getName());


(5) Yes, truly great. it's now almost 2010 and yet none of the popular logging engines allows printf style logging. - Lars Tackmann
(1) slf4j allows {} placeholders. I believe Ceki has timed it to be the fastest approach. - Thorbjørn Ravn Andersen
(2) I'd put up with slf4j's {} placeholders (and their not having room for String.format options like "%,d") if it had varargs-style methods. As-is, you can only pass up to two parameters per message; I regularly do more than that. Unless it's changed since the last time I looked? - Ed Brannin
[+16] [2008-12-03 18:49:28] P Arrayah

Apache Wicket [1], POJO-based web application framework. That description is short but it's beyond powerful, check the examples from the site and you should understand why.


(2) I'm currently building my first Wicket app, and the only thing I can say is that this framework is awesome! Like P Arrayah said, just check the examples... - Séb
I've used Wicket for about a month now in a project, and I have to say it's a refrehsing way to do web stuff with Java! You end up with clean HTML and clean Java. Co-operation with dedicated front-end (HTML/CSS/JS) developer has been smooth too. - Jonik
This is more a framework than a library if you ask me - Shervin
[+16] [2010-06-19 03:09:36] Arun P Johny

Ehcache [1] is an open source, standards-based cache used to boost performance, offload the database and simplify scalability.


[+16] [2009-08-01 13:18:17] jpartogi

H2Database [1]. Really useful during unit testing. Slightly faster than HSQL.


(3) Depending on what you're doing, can be MUCH faster than HSQL, especially with complex queries. Has a lot more features too. - BobMcGee
[+14] [2009-08-15 19:38:08] Ikon

Processing [1] is a pure, java based graphics and multimedia library, that has been used by even artists. I myself use it for it's simplicity and power of 3D drawing. There are many plugin libraries for it too. The speed of it's drawing and graphics manipulating capabilities are georgeous! There is a Javascript and Ruby port of it.


[+14] [2010-08-14 09:02:28] Inv3r53

Liquibase [1]

For managing database updates.supports many databases and is extensible for custom requirements.


An incredible library. - Tom
[+14] [2009-03-09 18:57:49] Pyrolistical

Can't believe we missed Java Service Wrapper [1]


Yes, but probably still should rank below Launch4j. - djangofan
[+14] [2008-09-29 02:10:25] Nathan Feger

Rhino --

a javascript compiler/interpreter, allowing the execution of javascript within your java app.

It's a Javascript compiler/interpreter -- would help to add this to your description. - Jason S
[+13] [2008-09-24 22:24:01] thoroughly

It is exceedingly useful to dynamically generate files from templates:

  • Velocity [1] -- Generate text from templates (SQL queries, email, HTML, etc..)
  • jXLS [2] -- Generate XLS files from templates

Please list just one library per answer as the question states. - mcherm
[+13] [2009-03-10 11:15:40] Jonik

Terracotta [1]

With it you can, for example, make a server-side application support clustering without having to litter your code with clustering infrastructure. You basically define "shared roots", globally distributed methods, instrumented classes (whose instances will be passed between JVMs), etc, in a configuration file, and in Java code just make sure access to those is correctly synchronized.

(Terracotta can be used in other scenarios too, but clustering is what I'm most familiar with.)

It's open source and free (for most uses at least), but commercial licensing options [2] and support are also available.


[+13] [2009-05-19 16:49:52] Paul Morie

ASM [1], the Java bytecode manipulation framework and CGLIB [2], the code generation library. A lot of the frameworks (viz. Hibernate) here rely on ASM and CGLIB (which itself relies on ASM) to do their magic.


(2) Wrong way round - CGLIB uses ASM, AFAIK. Check out Without these gems a lot of the cool tools listed here wouldn't exist. - CurtainDog
(1) I believe that you're correct -- I was mislead by the ambiguity of the relationship expressed on the CGLIB site: - Paul Morie
[+13] [2009-06-08 14:44:27] GHad

I think JNA [1] (Java Native Access) should be on the list for easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required (from the website)

We're using it for direct calls to Windows software and DLLs; it works really well and can be a huge time saver.

Greetz, GHad


[+12] [2009-04-22 18:08:24] StaxMan

Jackson [1] for JSON processing: a full-featured library that does very fast streaming read/write, full data binding (lists, maps, primitives and beans, without custom code) and even dynamic tree model if that's more your style. Most libraries only offer one or two of the abstractions; do not support efficient handling of input via InputStream, or require you to work with their own non-standard types.


Look at another answer about GSON as well. - Fakrudeen
Jackson is fantastic. I haven't used GSON, but have difficulty imagining another library offering more functionality, or being easier to use. If you use its SMILE serialization and use the streaming API, you can make it almost as fast as protocol buffers. - gsteff
And, as per recent 1.9 release, even faster... (check out jvm-serializers once they are published). Although at these speeds, differences do not matter all that much. But at very least you do not have to give up flexibility of json/smile for performance reasons. - StaxMan
[+12] [2009-01-11 07:29:22] Peter Štibraný

XOM [1]

XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with Java that strives for correctness, simplicity, and performance, in that order.


[+12] [2011-05-04 17:06:20] cheekoo

For any http client tasks, we user apache's httpclient [1] library.


HttpClient is a very powerful lib for high performance parallel requests. - Stephan
[+11] [2009-01-15 10:23:13] Brian Agnew

The Apache JXPath [1] is a great little library, yet remarkably unknown. It allows you to access Java object methods using XPath-like syntax. For example, rather than writing:

for (Person p : getCompany().getDepartment().getPeople()) {
   if(p.getName().equals("Brian") {

You can write:


(A trivial example. XPath can do so much more)

It doesn't make so much sense hardcoding this, but it's very useful for configs etc.


Looks useful - I've been learning XPath and the syntax is very nice - I82Much
[+11] [2009-01-25 21:54:22] Jonik

DWR [1] (Direct Web Remoting) - Makes it quite easy to do Ajax calls to server-side Java code from JavaScript running in the browser.


(1) dwr saves so much time. It also has reverse ajax capabilities. - James
[+11] [2008-12-03 18:44:50] Gilles

JMonkeyEngine - 3D scene engine [1] Have a look to the demos.


[+11] [2008-09-26 01:16:10] OscarRyz

What are some of your can't-live-without Java libraries?


It is java, it is free, it is good, and I can't live without it.

Don't make it less for live in the core :)

(11) These are NOT third-party libraries. - Stephen C
(1) When I first posted this answer, the question was "What is the most useful free libraries" It didn't say anything about 3rd party, back then. - OscarRyz
[+11] [2010-06-19 03:11:11] Arun P Johny

I can't think we missed Java Mail [1]


Maybe it wasn't mentioned cos it strictly speaking isn't a "third party" lib, is it? :) - Jonik
(3) I personally think it's terrible, unintuitive, hard to learn and user - lechlukasz
[+11] [2010-03-17 11:56:46] lenkite

SLF4 [1] and Logback [2] are the best for logging. I am surprised that people are still talking about commons-logging (awful) and log4j.


[+10] [2008-10-02 08:35:02] Steve McLeod

Note: This is a duplicate of another answer [1] to this question (and that other answer has more votes as I write this, so vote up the other answer!). Notes from this answer have been merged there.

Google Collections

It's gradually altering my whole coding style. Preconditions, Functions, Transformers are stupendous once you get the hang of them.


[+10] [2008-09-29 01:49:16] Andrew Swan

Most of my faves have been mentioned (like Apache Commons, Hibernate, and Spring), but I'd like to add:


(1) One suggestion per answer would give use the option to vote on each - Shervin
The question is about libraries. checkstyle is a tool. - Martin Schröder
[+10] [2009-01-25 22:00:54] Jonik

Dom4J [1] - Library for XML / XPath / XSLT handling


For my quest to find a better Java XML library to replace dom4j, see… - Jonik
[+9] [2008-10-24 13:50:01] welterde

Substance [1] A nice Swing LaF.

(SLF4J removed from this answer; upvote this one [2] instead.)


Saw SLF4J (+12) on page 1 by StaxMan - crowne
[+9] [2009-07-21 23:33:29] jpartogi

Jython [1]. Yes it's still alive people, and they've just released 2.5 recently. It's quite useful to call Java libraries using less verbose Python syntax in a day-to-day administrative tasks.


Good call, +1. We use it (to implement a scripting API inside our Java app). Its development could be more active, etc, but still: for bringing Python and Java together, Jython is the way to go. - Jonik
(1) Is this a java library? - Shervin
@Shervin: yes, this is a Java library. It is a library that parses script files (written in Python) and executes them. One example of how I used it was to provide a debugging mode for my app where the user logged on at a console and could interactively debug the live server. - mcherm
[+9] [2010-06-15 10:59:25] Lalith

JAXB [1] - JAXB allows Java developers to access and process XML data without having to know XML or XML processing, validate source data against an associated schema, JAXB allows access to data in non-sequential order, but it doesn't force an application to navigate through a tree to access the data etc. etc


Having been doing quite a bit with it recently, my feeling is that JAXB is over-subtle and finicky. There are just too many cases where the path between greatness and crud is a very fine line. - Donal Fellows
(1) Comes with the JDK, so I'm not sure this qualifies. - Joshua Davis
@Donal Fellows - Actually, it's pretty easy to use once you get the hang of it. - Joshua Davis
It's part of the JDK! - jirka.pinkas
[+9] [2009-03-19 16:18:52] zzztimbo

XMLBeans [1] - XMLBeans is a technology for accessing XML by binding it to Java types. Why work with XML when you can work with classes/objects?


(1) Not that I have anything against XMLBeans, but my impression has been that it has been mostly superseded by JAXB... (it still should get lots of credit for paving the way tho, JAXB v2 wouldn't be as good as it is without XMLBeans). - StaxMan
[+8] [2009-04-22 18:18:50] Adam Paynter

JUNG - Java Universal Network/Graph Framework [1]

Comes with many standard graphing algorithms. Provides some sane algorithms to lay out vertices in visualizations.


[+8] [2009-06-02 16:12:55] bogertron

While not Java specific, Axis and preferably Axis 2:

Makes creating web services very easy and it works with a few different serialization libraries to allow objects to be sent from clients to servers without having to do any serialization on your side.

Axis 2 has a completely different set up than the original axis, but the changes are worth it.

That is if you are creating web services

(1) Prefer CXF actually, but whatever works for you.. - Tim
[+8] [2009-05-10 23:54:49] TomA

I recommend the Simple XML library [1] for XML serialization. It can do virtually anything you need. Add a few annotations and you're done or you can customize everything to make it deserialize a 3rd party XML format into your classes. And, as the name suggests, it is really simple. Great documentation, under active development, top notch stuff.


(1) How does it compare to JAXB (v2, Sun ref impl)? Or, rather, how is it better (sounds like it does much/most of what JAXB does)? - StaxMan
Sorry, I don't know JAXB. Simple XML works like this: you take a class you want to serialize, add a @Root annotation to it and then you add @Element, @ElementList and @Attribute annotations to its fields. That's it, next step is a single line read or write to a XML file. There are many options for customizing everything, so its possible to match an existing schema, have optional fields, add callbacks etc. - TomA
[+8] [2008-09-24 21:41:17] Dan Dyer
  • JiBX [1] for XML data-binding.
  • JFreeChart [2] Swing graphs and charts.
  • H2 [3] pure Java embedable database engine.

JFreeChart is a fantastic framework - tim_yates
(2) Seperate posts please to enable fair voting... - mattburns
(1) @mattburns This answer is 2 years old and somebody has changed the question into a poll since I answered. This is an answer to a different question. - Dan Dyer
Ah, sorry, my bad! - mattburns
Dan, you could still split these in separate posts (actually JFreeChart and JiBX have entries already, so just dedicate this to H2) now that the question is a poll. I mean, it's not like there's much value in preserving this CW answer in its original form when it could be made into something more useful. - Jonik
Oh, there's a separate one for H2 too already. Heh. Well, if nothing else, there's a great opportunity here for achieving a Disciplined badge. :-) - Jonik
[+8] [2008-09-25 03:07:45] David

Name: JFugue


Purpose: Playing music in one line of Java code

(Not the most business-minded library, but definitely great for being creative and programming for fun!)

[+8] [2008-09-25 00:48:14] serg

OpenSymphony [1] has a really nice set of various open source java projects. The ones I used and enjoyed:

  • Quartz [2] - a full-featured job scheduling system
  • OSCache [3] - a caching solution that includes a JSP tag library and set of classes to perform fine grained dynamic caching of JSP content, servlet responses or arbitrary objects.
  • OSCore [4] - a set of utility-classes (manipulations with strings, dates, xml, etc)

Both Quartz and OSCache are well integrated with Spring.


[+8] [2011-02-09 12:44:45] Aito

akka [1] Simpler Scalability, Fault-Tolerance, Concurrency & Remoting through Actors


[+7] [2011-05-04 17:07:19] cheekoo

For REST webservices, Jersey [1] is a definite win!


[+7] [2011-05-08 06:14:48] Drew

My favorite Java library is Spring framework, and I automatically include it in any new project. This answer could be considered a duplicate of a previous post [1], but I needed to add that this library is not only "used for MVC (Model-View-Controller) projects."

The Spring "Inversion of Control" Container is a standalone lib (separate from SpringMVC) and is critical because it allows you to have cleaner, decoupled code [2]. You will always have people that decide to hard-code some database entry that will only ever work when run inside a Java app server like Websphere, but Spring allows you to configure your code so that you can do things like inject in a alternate/fake source of data. This is key to being able to write unit tests.

Another strength of core Spring is its ability to allow you to avoid traditional heavyweight J2EE code [3].

Developers take one look at EJB 2 and rightly run to any other platform such as Ruby on Rails, but you actually have a somewhat lightweight Java option with Spring. (Keep in mind that Java is verbose and if you simply can't stand boilerplate but are locked into the JVM, you can look at Grails [4] or Roo [5] or Play [6].)

Where I work, we use Struts2 + Hibernate + Spring IoC, and actually completely avoid SpringMVC, and still build solid Java webapps.


Duplicate answer. - Martin Schröder
[+7] [2011-04-14 13:02:56] Moritz Heuser

Hamcrest [1], from the homepage:

Provides a library of matcher objects (also known as constraints or predicates) allowing 'match' rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules.


[+7] [2008-09-24 22:12:14] bmw0128

Dozer mapping library, very usefule going from JPA generated classes to domain classes

[+7] [2008-12-09 00:33:40] Chinnery

json-lib [1] provides convenient functionality for parsing JSON strings into/out of Java objects. This is quite helpful if you work on Ajax web apps.


[+7] [2009-05-26 17:19:04] community_owned


A great substitute for ReadLine, written in pure Java, portable between platforms (specifically Linux and Windows).

Here is example use. [1]


[+7] [2009-05-07 17:22:27] Roland Tepp

StringTemplate [1] as a general purpose templating engine. It's simple yet ingenious...


[+7] [2010-10-18 11:43:10] rich

Guava: Google Core Libraries for Java 1.5+ [1]


(3) Duplicate answer - Shervin
[+6] [2010-06-24 08:02:47] chedine

Drools [1] - A great BRMS API. Very useful to manage your ever changing business rules.


Also related - JBPM - in fact JBPM and Drools got merged in JBPM 5. - Fakrudeen
[+6] [2009-08-21 14:56:06] dfrankow

args4j [1], a most sensible way to parse command-line arguments.


I agree, very easy to use for my needs - I82Much
[+6] [2009-08-25 09:21:57] Alexander Malfait

Library: FlyingSaucer / XHTMLRenderer [1]

Purpose: Render XHTML / CSS to PDF or a Swing component (and do so wonderfully well!)

It's the only way I write reports anymore.


[+6] [2010-04-08 10:46:44] Shervin

If you use JSF alot, then you cannot avoid JBoss Seam [1]. It is awsome! Of course it is not only required when running JSF.

It is a very nice library for Java EE. It was Seam that led to Context and Dependency injection and alot of the features in Java EE 6.


[+6] [2009-05-05 22:38:28] BobMcGee
  • Name: GNU Trove [1]
  • What: primitive collections (avoids autoboxing/unboxing of primitives to objects)
  • Competition: pcj [2], but Trove is more stable and recently maintained. May be faster too.
  • Why: faster and lighter on RAM than object-based collections.

Suggested Uses: ANY time you're storing a lot of ints, chars, or longs in memory and running out of memory. Doubly useful if collections are having items added/removed/modified a lot, because these operations are much faster on primitive objects.

Also useful in cases where very predictable performance is needed and garbage collection pauses cause problems.

ANYTHING that does work with graph-style relationships between RAM-expensive objects will benefit, because you don't need to store the objects in memory, just an int or long unique identifier for each. Persist the objects to disk, and let TIntIntHashMaps store relationships. You can store 8x as many relationships in memory for the same RAM use as a vanilla HashMap.


(2) we've found fastutil to be as good or better, and has more features. - Kevin Bourrillion
(1) I don't think fastutil was out when I first looked for this. It does seem more full-featured, but isn't it kind of a large library, with all the different collection variants? - BobMcGee
[+6] [2009-05-12 15:05:54] user102188

I'm surprised no one has mentioned iBatis (ORM/Persistence for people who like to use actual SQL code) or JMock (mock objects).

It would be better to put one library per answer so they can be voted on separately. Could you dedicate this post to just JMock (since Ibatis is mentioned separately here:…)? - Jonik
+1 for iBatis, it's wonderful! - Jim Ferrans
Now called myBatis. Probably the easiest framework for working with stored procedures I've ever seen - simple, easy fast annotation-based sproc integration. - Will Iverson
[+6] [2008-10-22 07:51:09] Jan Gressmann

Another vote for SWT [1]. GridLayout is so much better than Swing's GridBagLayout (of which I have nightmares about). Although, SWT has some glitches, If I have the choice, I'd always prefer SWT to Swing.


[+6] [2008-09-25 23:38:37] Pyrolistical

Name: Uncommons Maths


Purpose: Generics enabled CombinationGenerator! A Random seed generator

Seems to be removed, wasn't so good? - Stepan Vihor
updated the link - Pyrolistical
[+6] [2011-07-19 08:13:47] SP Sandhu

Apache log4j

used for logging events for use with 3rd party APIs

log4j homepage [1]


Duplicate answer. - Martin Schröder
[+6] [2011-02-17 18:57:46] Pantelis Sopasakis

Reflections [1] - Source code runtime meta analysis; a step beyond the standard Java reflections API [2]. I've found it useful in lots of projects requiring exquisite reflectional manipulations.


[+5] [2010-11-16 09:08:42] Ricardo

DynamicReports - an open source reporting tool [1] based od JasperReports. It allows to create dynamic report designs and it doesn't need a visual report designer.


[+5] [2010-11-18 08:26:24] Igor Spasic

I love Jodd [1]. First, it is a small library and very fast. The jodd tools contain the set of various tools you need it everyday, and all that packed in one jar. Besides many utilities, inside you can find smaller groups of functionality, like: yet another BeanUtil library (but this one treats fields as part of the property and has some more interesting features), JDateTime that uses astronomical algorithm for tracking time and very very user friendly (ah,I hate Calendar!), Email... I like it also since you can check the code and you will immediately understand what is going on.

Besides tools, there is the second part of jodd, called jodd-wot, which contains all necessary frameworks: ioc container, interresting and different aop, database mapping, nice web framework, jtx, validation.... so everything you need to build a good web app, but with only like 7 jars:) The effects are huge, imho: my tomcat starts in seconds, memory consumption is lowever, the amount of written code is less then usual, and so on.

Downside is that you really have to explore it. API is quite good, and there is even an real-life web app example, but still, in the beginning you are not aware of whats everything inside, and the documentation can be better.


Can you add a little bit information on Jodd in your answer? - nimcap
You are right, I've just did. Maybe its too much now, but still i believe its helpful. - Igor Spasic
[+5] [2011-07-19 08:20:17] SP Sandhu


It's a great library and wrapper for deploying SMS HTTP servers and bulk messaging through your personal mobile phone/GSM modem.

SMSlib homepage [1]


[+5] [2011-06-14 13:49:49] Cengiz

Flyway [1]: I use it for as a part of continuous delivery. Let the application update its database.


[+5] [2011-08-26 10:23:03] lechlukasz

PowerMock [1]

Another mocking library for Java, but adding new very powerfull posibilities, including mocking static methods and constructor invocations. Even static methods from JRE can be mocked.

I've found myself a few times where I needed to rewrite code to enable full testing with mock (f.g. creating utility beans to replace static calls), with this library it's no longer required.


[+5] [2011-08-30 07:28:19] lechlukasz

When I need to process HTML (which normally means I can't expect it's well-formed) I usually use Jericho [1]. They have great examples on their page, from which you can quickly learn how to use it.


[+5] [2008-09-26 11:47:27] Horcrux7

The Java Spell Checker JOrtho [1] can be use very easy with any GUI application.



[+5] [2008-09-24 22:01:23] anjanb

JDOM, for java XML parsing -- servlet utils including download/upload, etc
bindings to curl for http download/upload
code from the squirrel SQL client for accessing DBs
the original JDBC driver for accessing MySQL.

it takes a while to think about all the stuff that's been useful to you over the years.

[+5] [2008-09-24 21:35:10] Mnementh

JTS Topology Suite [1]: If you work with geographic data it's very useful. It's so useful, also C++-programmerswant it, so it was ported to C++, a library named GEOS [2] (Geometry Engine Open Source).


[+5] [2010-03-06 16:55:58] Navi

[+5] [2010-06-19 03:16:51] Arun P Johny

Jep [1] is a very good Java library for parsing and evaluating mathematical expressions.


[+4] [2010-08-19 02:54:22] Avi Flax

Restlet [1] is an excellent framework for building and/or working with RESTful systems. I've been using it in many production systems for years and it's been a huge boon.


This lib is over engineered! - Mayumi
[+4] [2010-10-18 15:04:51] ivorykoder

Nobody mentioned Java image utilities [1]??

A Java library for loading, editing, analyzing and saving pixel image files.

It supports various file formats.

Provides demo applications for the command line. It has AWT GUI toolkit too.


[+4] [2010-06-19 03:14:54] Arun P Johny

Jruby [1] is a pure-Java Implementation of Ruby [2] programming language


(1) This is not a library - Shervin
[+4] [2010-03-29 01:17:23] StaxMan

jDBI [1] for simple, safe, no-nonsense relational data access (esp. for simpler use cases than what Hibernate et al are good for). For some reason it is not very well known, but it is an absolute pearl.


I think it is not well known as the authors (I am one) have never tried to market it. It solves our problems, really well, and folks are very welcome to use it. Bugs tend to get fixed (and a release cut) within an hour or two of being reported, it is stable, and it works. - brianm
[+4] [2010-01-11 15:31:39] Steve Wall

I had a need to perform deep equality checks within my test cases. The commons EqualsBuilder.reflectionEquals didn't go deep. The "assertReflectionEquals" feature provided by unitils was a life saver. I didn't have to write equals methods for all my classes and the generated error message when objects don't equal precisely identifies the attributes. This is the best deep equals utility I was able to find.

[+4] [2009-11-26 04:39:58] I82Much

JGraphX [1] is a very useful library/framework for visualizing / editing networks/graphs. Perhaps less sophisticated for visualization than Prefuse, but very good for creating the graphs in the first place.


[+4] [2009-08-04 20:37:08] Dave Jarvis

JOpt Simple [1]

For parsing command line options, similar style to Unix commands. The API is simple, while offering an immense feature set [2].


[+4] [2009-06-08 01:29:01] danieljimenez

jawr [1] - "Minifies" and compresses Javascript (and CSS) on the fly. It even has development flags you can set to disable compression and minification to allow you to debug readable Javascript. Also integrates with DWR!


[+4] [2008-09-24 21:43:17] the.duckman

PCJ [1], Primitive Collections for Java.

This is a the fastest implementation of a Collections framework around primitive datatypes, providing for example Maps with ints as keys or Lists for floats. Much faster and more memory efficient than Sun's classes (where you have to use Integer and Float as wrappers with substantial cost), and also faster than its "competitors" fastutil [2] and trove [3]. Unfortunately no generics and not being maintained anymore - is stable though.


[+4] [2008-09-25 12:52:34] mitchnull

Some of the stuff we used:


(1) We've also used jCIFS... Any chance you split this to separate posts so that the libs can be voted on individually? - Jonik
[+4] [2011-06-30 18:52:27] wrick

Annotation library for generating getter/setter/constructor/hashcode/equals/tostring Easy configuration of various Loggers, implementation of val: Lombok [1]

Love contract-oriented programming? Use cofoja [2]

Want a web-app running in 5 minutes or do not want tons of XML/config files? Play [3]!

Scrape web pages with 2 lines of code using JSoup [4]

High performance library for primitive-collections - fastutils [5]


[+4] [2011-04-18 06:58:43] jmendeth

Tritonus [1] is an OpenSource alternative to the standard Java Sound API. Tritonus supports all of the features of the Sound API, and more.

Among other things, it supports use of the Alsa sequencer instead of the system's one.


(1) Why this downvote? Is there a duplicate? Isn't Tritonus a library? - jmendeth
[+4] [2011-02-09 12:46:46] Aito

Apache Camel [1]

Apache Camel is a powerful open source integration framework based on known Enterprise Integration Patterns with powerful Bean Integration.


[+4] [2011-02-11 12:58:53] Brent Hecht

Geotools [1] is fantastic for serious geographic information tasks.


[+3] [2010-11-27 17:38:26] Venkat

JGroups for multicast communication

[+3] [2008-09-27 22:02:51] Uri

Apache-commons [1] if you need a lot of utilities that the Java standard library left out (e.g., collections, XML, etc.)

JMS (can also get as part of J2EE) if you need to reliable send messages from one machine to another and don't want to deal with the hassle of maintaining your own queues.

I'm also a fan of SWT for GUIs (mostly used as part of the Eclipse project)


[+3] [2008-10-03 11:15:01] Vihung

Castor for Java-XML binding

[+3] [2008-09-29 02:12:49] Nathan Feger

A port of apache collections with parameterization:

I feel like there is another one of these too, but I can't think of it.

[+3] [2008-11-10 10:44:17] rayyildiz

(2) Could you split this to separate answers for each lib? Now it's impossible to tell which upvotes are meant for which libraries (-1, for now, because of this). - Jonik
[+3] [2008-11-27 14:00:43] Vinze

Jena Semantic Web Framework [1] for work with RDF and OWL models


[+3] [2008-12-03 18:41:34] community_owned

Pingel Math library

ANTLR for parsing

Any chance you split this to separate posts so that the libs can be voted on individually? - Jonik
[+3] [2008-12-04 16:27:41] Jonathan

Stripes framework [1]

It's a lightweight annotation-driven presentation framework.

Freemarker [2]

A superb templating engine.


Any chance you split this to separate posts so that the libs can be voted on individually? - Jonik
[+3] [2008-09-25 09:06:51] tropikalista

Java Uuid Generator (JUG) for creating unique values..

(8) If you're using Java 1.5 or later you can simply use java.util.UUID.randomUUID() - Johan Pelgrim
Yes, and that's a good method. But I have noticed some people prefer time+location based method (there are 3 methods, last one is name-hash based) over random one. Mostly because it intuitively seems to have stronger guarantee of uniqueness (which is not really true, IMO, but intuition sometimes leads one astray :) ) - StaxMan
[+3] [2008-09-25 00:21:52] Ryan Thames

JAXB [1] is nice.

jFreeChart [2] is great for charts.

Spring is also very nice.


(4) All of these are mentioned in separate posts - mattburns
[+3] [2009-06-30 23:07:40] ykaganovich

TrueZIP [1] for providing interface to archives.


[+3] [2009-05-07 17:32:57] Apocalisp

Name: Functional Java


Purpose: Provides first-class functions, generic compound types, immutable (persistent) data structures, lazy (infinite) lists, parser combinators, actor concurrency, specification-based testing, flexible replacements for toString(), equals(), and hashCode(), and more.

[+3] [2009-03-19 16:27:02] Skubs

RichFaces [1] is an open source framework that adds Ajax capability into existing JSF applications without resorting to JavaScript, with a huge library of rich components and skinnability support.


(1) How, precisely, does one add AJAX (Asynchronous Javascript And XML) without resorting to Javascript? - JUST MY correct OPINION
I think what he means is that you don't directly write the javascript, however Richfaces does write the javascript for you - Shervin
[+3] [2009-01-25 22:48:51] Peter Lawrey

I find this to be a good list of free Java libraries

[+3] [2009-08-04 23:58:47] Richard Nichols

Markdown-Doclet [1] for including Markdown syntax in Javadocs rather than HTML.


[+3] [2010-03-24 13:17:45] Konstantin Petrukhnov

slick [1] - simple,fast,documented library for 2d graphics


[+3] [2010-06-19 03:36:42] Jason

How could you miss Eclipse BIRT [1]


[+2] [2010-10-06 01:28:57] jacklty

Nekohtml [1] - tidy up html into xml document for data processing (xpath/xslt)

TagSoup [2] - a SAX-compliant parser written in Java that, instead of parsing well-formed or valid XML, parses HTML as it is found in the wild


[+2] [2010-06-19 03:02:15] Arun P Johny

OSWorkflow [1] is a very power full workflow engine


[+2] [2010-05-14 09:24:20] rgksugan

Jpcap [1] - Using Jpcap, you can develop applications to capture packets from a network interface and visualize/analyze them in Java


[+2] [2009-12-17 21:47:45] jaxvy

Name: JXTA


Purpose: Allows developing highly scalable P2P communication networks among applications without coding everything from scratch.

[+2] [2009-07-27 21:50:57] jpartogi

PMD [1]. For helping finding those bad practices code. Really useful to make your code beautiful.


[+2] [2009-07-30 04:54:33] Dave Jarvis

Java Interface for Go [1]

API for Go-related applets and applications.


[+2] [2009-05-09 03:26:24] community_owned

I've found AjaxTags [1] very useful for DisplayTag updates without page refreshes and building servlet based autocompletes. It's one of several libraries for ajax development with minimal javascript coding. The site also has some great demo to try out.


[+2] [2009-02-12 22:58:08] user19810

I use jcharts quite a bit. Great for creating a variety of graphics.

[+2] [2009-04-30 06:02:51] zvikico

[+2] [2009-06-22 10:03:46] Ibn Saeed

Name: ACM Java Task Force Library

Website: ACM Java Task Force Library [1]

Purpose: To review the Java language, APIs, and tools from the perspective of introductory computing education and to develop a stable collection of pedagogical resources that will make it easier to teach Java to first-year computing students without having those students overwhelmed by its complexity.


  • A simple object-oriented model for programs.

    The Program class defined in the acm.program package offers an easy-to-use model for writing simple programs. In addition to hiding the static main method, the Program class and its standard subclasses provide a highly intuitive example of object-oriented class hierarchies.

  • A model for input and output that treats traditional console I/O and dialog I/O symmetrically.

    The package defines the classes IOConsole and IODialog that share a common interface for all input-output operations. This design addresses the lack of a simple input mechanism in a way that emphasizes the value of interface-based design.

  • An extensive library of graphical objects.

    The package implements a simple but extremely powerful model for creating graphical pictures based on the metaphor of a felt board in which students construct graphical objects of various types and place them on a canvas. This design emphasizes the use of objects and frees the student from having to respond explicitly to repaint requests.

  • A minimal set of new classes to support development of graphical user interfaces.

    The acm.gui package includes a small set of classes to bring Java’s extensive GUI-development resources within reach of novice programmers.

  • Backward compatibility for applets.

    Unlike most Java code today, programs developed using the JTF packages can typically be executed as applets even on older web browsers. This flexibility makes them ideal for web-based teaching tools and lecture demonstrations.


[+2] [2009-06-02 16:17:07] Jason S

JavaBuilders [1] -- lets you specify creation/parameters/bindings of a GUI layout in a succinct format; flavors exist for Swing, SWT, and GTK+.


[+2] [2009-06-02 17:17:43] TomA

LWJGL [1] for OpenGL and OpenAL wrappers and polling input devices.


[+2] [2009-06-02 22:25:31] sbidwai

Surprised to see not much of JBoss stuff here apart from Hibernate.

Anyways, one of my favorite tools is Drools/JboosRules engine.

Not sure how many use Antlr, but I require it lot of time.

ANTLR is mentioned elsewhere; could you dedicate this answer to Drools only? - Jonik
[+2] [2009-05-12 17:42:14] John Munsch

JGAP [1] - It's a package for doing genetic programming quickly and easily. I was able to use it the first time and had an answer to a question in four hours that humans had previously spent days on and not gotten nearly as good an answer.

If you need to answer questions about efficiency (fastest, cheapest, least distance, etc.) or even if there is any solution at all with a given set of constraints within a complicated system involving lots of variables then JGAP is your best friend in the world. Don't automatically assume it's just for academic wonks, it's every bit as applicable in real world circumstances.


Well if Ceiling Cat says it's good, I'm convinced! - Andrew Swan
I've used JGAP. It was a little awkward. If I had it to do again, I'd try - dfrankow
[+2] [2009-05-12 17:43:49] alamar

Apache Xalan.

It's buggy and shabby, but we absolutely can't live without it.

Not that I dislike Xalan, but isn't Saxon better in many ways? - StaxMan
Maybe it is, I didn't try it. Why not nominate it? - alamar
[+2] [2009-06-02 16:02:22] thedude19

I've used JHotDraw [1] for a few projects. It's a great 2D graphics framework for structured drawing editors.


[+2] [2008-12-09 21:41:09] Karl

JiBX [1], a seriously underused XML mapping lib


[+2] [2009-01-11 10:20:38] community_owned

Piccolo2D [1] (formerly Piccolo)

Toolkit for development of 2D structured graphics programs, in general, and Zoomable User Interfaces (ZUIs), in particular. Good for highly interactive user interfaces.


Source code for 1.2.1 does not build out of the box. - Dave Jarvis
[+2] [2010-11-24 13:46:58] Dan

BIRT [1] - I see Jasper Reports mentioned but having gone through an evaluation I prefer BIRT.


[+2] [2011-03-13 05:23:28] Berlin Brown

This is really subjective, but you can't go wrong with this stack.

Guice for IOC Container (better Java code)

Spring IOC Container (better Java code)



Lucene (awesome indexing software)








Apache Wicket


[+2] [2011-03-16 01:04:15] Mat Banik

sitemapgen4j [1] - very helpful if you are building sitemap generator for your website. Supports sitemap compression and multiple archive files. Saved me lot of work.


[+2] [2011-04-14 11:54:27] Nesteban

simplecaptcha [1] is a simple framework for generation of CAPTCHA image/answer pairs that help strengthen security of login and registration forms. It supports internationalization, and is quite simple to use and customize.


[+2] [2011-05-11 14:30:04] Wivani

In recent projects Apache FOP has been used extensively. I'm surprised I couldn't find it anywhere in this list ...

Website: Apache FOP [1]

Purpose: FO (Formatting Objects) Processing; meaning that in most cases data in xml is transformed to xsl-fo and then processed to output to a pdf or postscript or ..


[+2] [2011-08-06 03:45:47] Rachel

QueryDSL [1] enables the construction of type-safe SQL-like queries for multiple backends including JPA, JDO and SQL in Java.


[+2] [2010-12-16 19:33:49] Jamshid Asatillayev

tika -parser library for almost all kind of text formats and also extracts metadata from audio/video. supported formats [1]


[+2] [2011-09-05 21:18:12] Jonik

XMLUnit [1] — Extension lib for JUnit that can simplify all kinds of XML-related unit tests.

I've used it e.g. to verify correctness of generated XML using XPath expressions. Examples:

XMLAssert.assertXpathExists("//category[@label='2/2011']", document);

XMLAssert.assertXpathEvaluatesTo("3", "count(/result/row)", docString);

// test that all input fields have an id:
assertXpathValuesEqual("count(//input[@id!=''])", "count(//input)", document);

Curious that this wasn't mentioned yet (though there were 176 older answers); XMLUnit definitely is useful and should be on this list.


[+1] [2011-11-02 02:47:49] Novice Coder

jsch.jar [1] provides support for secure remote login, secure file transfer, and secure TCP/IP and X11 forwarding. It can automatically encrypt, authenticate, and compress transmitted data


[+1] [2011-08-28 09:04:53] jirka.pinkas

Apache Derby [1] - Relational SQL database written in Java.

I know you can install it with JDK, but I usually download it separately, because the version on the website changes much more rapidly than version that you can install with JDK.


[+1] [2011-08-17 10:37:54] TheCharliemops

Name: XSOM [1] (by Glassfish)

Licence: CDDL (which basically allows you free use and redistribution with your application) and GPL v2

Purpose: Parse XSD more easily than with JDOM or similars


[+1] [2011-08-18 18:24:16] djangofan

Beanshell [1]. Scripting framework that is planned to be eventually integrated in the the J2SE and when JRE Lambda expressions [2] are finally implemented , then this will become very powerful. ;-)


[+1] [2011-08-18 18:52:23] Reverend Gonzo

GlazedLists [1] to make working with large datatsets painless, especially when it involves filtering, sorting, transforming, and using as models for swing components.


[+1] [2011-04-20 07:15:18] C. Reed

Flanagan's Scientific Library [1] has some helpful aspects for scientific computing in Java, e.g. (weighted) Regression [2]


[+1] [2011-06-22 04:02:25] Gevorg

JADE [1] - Java Agent DEvelopment Framework

an open source platform for peer-to-peer agent based applications. It's fully compliant with the FIPA specification -Foundation of Intelligent Physical Agents- and provide a set of graphical tools that support the development, deployment, and debugging phases. The agent platform can be distributed and controlled through a remote GUI.

A little raw but yet powerful GUI [2]s

I used this for my master thesis. Thanks!! You know who you are! ;)

See also WADE [3] - Workflow and Agents Development Environment

A JADE based platform that provides support for the execution of tasks defined according to the workflow metaphor. This I haven't used...


[+1] [2010-11-11 15:49:51] Arul

JAXB [1]

For xml marshalling and demarshalling .. It just an another good java api...


yes now only i seen .. is there any way search within a thread in stackoverflow..? - Arul
and it is also part of JDK. - jirka.pinkas
[+1] [2011-11-25 22:40:18] Geno Roupsky

Name: Weld


Purpose: Weld is the reference implementation (RI) for JSR-299: Java Contexts and Dependency Injection for the Java EE platform.

[+1] [2011-12-03 02:19:17] Nathan Smith

Two that haven't been mentioned that I love and use extensively here at BranchOut:

Jackson [1], Tatu Saloranta's excellent JSON marshaling/unmarshaling library.

Metrics [2], an unobtrusive, simple, and extremely useful metrics collection library, written by Coda Hale.


[+1] [2008-09-25 12:57:27] community_owned

MessAdmin [1], a fantastic HttpSession administration tool, and giving detailed statistics and informations on any Web application. It installs as a plug-in to any Java EE WebApp, and requires zero-code modification.


[+1] [2008-09-24 22:44:45] PhiLho

It is a bit subjective, something you can't live without might be useless for me... :-)

Anyway, here are some I bookmarked (I haven't used all of them!):

  • Batik [1] -- SVG parser/viewer.
  • etlFTPj [2] -- A FTP library.
  • TagSoup [3] -- An HTML parser, able to handle the bad HTML we see in real world.
  • StringTemplate [4] -- A (generic) template engine enforcing strict principles (no Turing-complete).
  • FreeMarker [5] -- Another template engine, more procedural, still strict on document/view separation.

There is lot more, that's one of the strong points of Java...


(1) +1 for TagSoup and StringTemplate :-) - Peter Štibraný
Any chance you split this to separate posts so that the libs can be voted on individually? - Jonik
-1 for StringTemplate, it has a few killer bugs making it unsuable: - dm76
[+1] [2008-09-24 22:34:21] Pyrolistical

Name: Lipermi

Website: WARNING: Use the CVS version for now, it fixes two major bugs.

Purpose: RMI alternative that uses only TCP. No more codebase urls!

[+1] [2009-09-25 09:12:27] xrath

WAX [1] for writing XML documents with less code.


[+1] [2010-06-15 11:05:33] Nils

Processing was quite useful for me.

-1, Duplicate of… - Rob Hruska
[+1] [2010-06-17 15:26:32] JasCav

I love me some JScience [1]. Makes a number of scientific tasks (for me, it was unit conversion) very easy.


[0] [2010-06-15 11:03:49] Lalith

Castor [1] - Castor is an Open Source data binding framework for Java[tm]. It's the shortest path between Java objects, XML documents and relational tables. Castor provides Java-to-XML binding, Java-to-SQL persistence, and more


(2) -1, Duplicate of… - Rob Hruska
consider upvoting (and commenting on) the other answer; having duplicates around isn't very useful - Jonik
[0] [2011-12-23 22:54:32] Piotr Sobczyk

I've just discovered Fest Assertions [1] recently and instantly started using it in my day to day programming. And already noticed profits of doing so.

Assertions can become quite complex and verbose in non-trivial unit tests. Fest Assertions is testing/assertions library that allows to write assertions using syntax similar natural language. For example:


This is also a good example to show that multiple assertions can be made in one line (they are AND-ed in that case, i.e. all of them must pass) which makes them much more compact.

I'm surprised that Hamcrest [2] - which I believe is far inferior (I say so after checking both of them of course) - is mentioned and voted up here (and seems to be generally much more popular) and FEST Assertions wasn't.

Three main advantages of Fest Assertions over Hamcrest are:

  1. Greater readability
  2. Excellent use of content assist feature of IDEs
  3. More intuitive and natural approach

So don' wait any longer. Include FEST Assertions in your unit tests!


[0] [2010-11-27 17:39:56] Venkat
Java Image IO is possibly one of the worst API:s I've ever come across. The other parts of JAI may of course be decent. - Esko
(1) Duplicate of this answer. Upvote that one instead. :) - Jonik
[0] [2011-06-25 13:34:09] Srikanth Venkatesh
DWR is good, but this is a duplicate of this answer. Please upvote that one instead. - Jonik
[0] [2011-11-02 02:57:43] Novice Coder

HttpComponents Client [1] has some useful Api's like legacy HttpClient, and new HttpCore ,HttpComponents Client and Asynch HttpClient to expand the role of the HTTP protocol beyond user-driven web browsers


[0] [2011-11-14 16:46:51] spiff

la4j - Linear Algebra for Java [1] - 100% single-threaded sparse and dense matrix library.


[0] [2011-09-20 00:40:12] Mike Gates

I would recommenend TreeMap [1].

As described on the website, it "shows efficiently tree data as a rectangle colored map. Useful to monitor thousand of files in a little window."

Licensed by: Geeknet, Inc.

You may also view it in more detail here [2].


[-2] [2009-01-09 13:25:47] alepuzio

I even work with:

  • Ant [1] for building and deploy of software.

  • Struts [2] for developing web application.


(4) Two items in one answer, Ant is not a library and Struts is a duplicate - finnw
[-7] [2009-01-29 17:55:12] grayger

Here are my choices.

  1. JUnit
  2. Log4J
  3. Apache Commons Configuration
  4. FindBugs (it is a tool rather than a library)

(7) -1, for now, because 1) some are duplicates 2) many libraries in one post - Jonik
(8) lol one negative vote should be enough I guess :( - Alfred