New to programming and to Java: These are books that aim to teach Java to beginning programmers. This means that the basics of programming (program structure, looping, control flow, object orientation etc) are emphasised along with the specifics of how these are implemented in Java. There are a lot of books in this area, and these are the ones that get the TechBookReport seal of approval: Objects First With Java, Head First Java, Java How To Program and Beginning Java 2.
Coming to Java from another programming language: Here the emphasis is on teaching Java. It is assumed that the basics of programming - though not object oriented programming specifically are understood. Recommended titles include:
Thinking In Java, Just Java 2, Learning Java and Java Examples In A Nutshell. Of course some of the beginner books are also worth considering.
Intermediate/advanced Java: These are books for those Java programmers who want to progress that little further. Effective Java, Java Cookbook and though not specifically about Java, mention must be made of Martin Fowler's classic Refactoring. Of course design patterns are a must and the best title for the intermediate/advanced Java developer is Holub On Patterns. Java Puzzlers takes a very different approach and is worth recommending for that reason alone - be warned, it's addictive. Multi-threading and concurrency are handled excellently in Java Concurrency In Practice. Finally, a book that isn't strictly about Java but has plenty to teach the programmer who wants to take a step up: Code Complete.
Enterprise Java/J2EE: Many of the beginner books also include some coverage of J2EE, particularly Thinking In Java, Just Java 2 and Java How To Program. Similarly there's good coverage of specific topics in Java Cookbook. For something more specific there's Teach Yourself J2EE In 21 Days. Anyone looking specifically for servlets and JSP out to take a peek at Murach's Java Servlets and JSP. Finally mention has to be made of Better, Faster, Lighter Java for a critical look at EJB.
Integrated Development Environments (IDEs): Java IDEs range from the heavy-weights like Eclipse, NetBeans, JBuilder etc, to lighter toolsets such as jEdit to snappy Java-aware editors such as JCreator and Gel. For good introductions to Eclipse then look no further than Eclipse or Eclipse 3 Live. For NetBeans there are fewer titles to chose from, but NetBeans IDE Field Guide is a good start. If you've never heard of jEdit or JCreator then take a look at our reviews.
Other recommended titles: Anyone serious about Java and XML ought to check out Processing XML with Java. Swing power users should definitely seek out Swing Hacks. And for something on coding styles then The Elements of Java Style is well worth seeking out.