What are Some Essential Java Libraries? 77
rleclerc writes "I would like to ask those 'Javaniers' in the Slashdot community what they thought were essential non-standard libraries that every Java coder should have. Normally I roll my own when it comes to that type of thing and simply build on whats available in the foundation classes. However, recent work has pushed me toward looking at some scientific libraries and I thought I would find out what libraries others in the Java community would consider an essential weapon in their Java arsenal. A few that I am looking at are the Cern scientific libraries and the Apache Commons Collections libraries. To avoid extra libraries I have opted to use the Java logging rather than the Apache one. Anyone like to add anything to the list?"
Before any project... (Score:3, Interesting)
First, make a plan of what your trying to do.. then go browse apache Commons.
There have been many times I got through a project, or part way into it.. and realized I could of saved a TON of time by using a tool from that resource.
If your doing anything with XML, it's worth taking a look at JDom.
Make sure your using Eclipse, and if your doing web based projects.. I highly recomend http://myeclipseide.com. I have been a subscribe for a while, and have really enjoyed the enhancements that their modules bring for web development.
cglib and more (Score:4, Interesting)
Xalan [apache.org] for XSLT and XPath processing. Here's a tip: Never, ever use SAX for XML parsing of application-specific data structures. SAX is a nice low-level interface for building upon, but unless you're programmatically emitting a document from scratch, it's painful to use -- you always end up writing a stack-based content handler to keep nesting state. XPath makes parsing a breeze.
JGroups [jgroups.org] (formerly JavaGroups) is a protocol stack for building reliable, fairly efficient network communications based on, among other things, multicast IP. The entire stack is user-defineable, so you can pick and choose the level of reliability and which features you want (TCP support, pinging, group membership management etc.).
Lucene [apache.org] is a text-indexing engine. It's actually pretty crap, and does not scale very far (we're talking a few seconds for result sets of only a few thousand documents), and the code is pure spaghetti (abstract base classes! Inheritance!), but if you need a little indexing engine or some decent text tokenization classes, and your performance requirements are modest, it works well enough.
SableCC [sablecc.org] is a good BNF-based parser generator that generates type-safe parse trees that can navigated at runtime. Unlike the more well-known JavaCC [java.net], it's easy to get started, not least because the BNF-like grammar is so simple.
My most favourite (Score:4, Interesting)
I'm currently building a variety of petroleum engineering tools in Java. Here are the libraries I've found most useful:
JFreeChart [jfree.org] - for all your plotting needs. Robust, quick, and fairly bug free. Not perfect, but hackable.
iText [lowagie.com] - a free Java PDF library. My preferred method for creating reports, especially since a lot of my output needs to be e-mailed or submitted to the government, not printed out.
JAMA [nist.gov] - a Java Matrix package. The fact that this library has a working singular value decomposition has saved me bunches of time programming a boring and tricky algorithm. I guess it has other stuff, too.
Re:Commons Logging is crap (Score:3, Interesting)
org.apache.commons.beanutils (Score:1, Interesting)
http://jakarta.apache.org/commons/beanutils/api
to cache the resultset in memory use RowSetDynaClass
to use a server side cursor use ResultSetDynaClass
Fastutil (Score:2, Interesting)
MG4J [unimi.it] from the same place is pretty interesting too.
Re:JDOM.org (Score:2, Interesting)