up vote 206 down vote favorite
32
share [g+] share [fb]

Which Java book do you think is the must-have one for all Java developers?

Keep in mind:

  • One book per answer
  • Check for duplicates before adding new answers
link|improve this question
show 1 more comment
feedback

migrated from stackoverflow.com Jul 10 '11 at 11:58

This question came from our site for professional and enthusiast programmers.

closed as not constructive by Walter, Mark Trapp Jul 10 '11 at 17:37

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion. See the FAQ.

49 Answers

1 2
up vote 334 down vote accepted

Effective Java, Second Edition by Joshua Bloch. No question.

If every Java developer read this book, there would be a lot less broken code in the world.

After that, I'd read Java Concurrency in Practice (see separate answer), and maybe Java Generics and Collections (see separate answer). Anyone that reads and puts into practice the information in these three books has come a long way toward mastering Java.


Comments from duplicate "Effective Java" answers:

"I sure wish I had had this book ten years ago. Some might think that I don't need any Java books, but I need this one."
- James Gosling, Fellow and Vice President, Sun Microsystems, Inc.

sammyo: It's a thin(!!) volume that focuses on real issues and how to think about the right approach to java problems. (as opposed to a listing of API methods)

Hans Doggen: First edition of Effective Java and then the second edition, to see some of the ideas that changed over time.

link|improve this answer
14  
Choosing an "answer" for this question is unfair. Each person answering posts their own opinion and the community votes the more relevant answers up. If a book better than EJ2 is released, this page might turn out to be useless, because one opinion is already anointed as the "answer". – binil Sep 16 '08 at 19:26
6  
"If every Java developer read this book ..." what you wanna say is "If every Java developer read and understood this book ..." – Chris Sep 25 '09 at 17:03
5  
+1000 for Effective Java, I have been reading this every day during my lunch break, and it's hands-down one of the best programming books I've ever read. – BlueRaja - Danny Pflughoeft May 18 '10 at 15:25
3  
@binil I don't see how any Java book could ever become more important than Effective Java 2nd ed. except for maybe... Effective Java 3rd ed. – jluzwick Feb 16 '11 at 18:06
show 2 more comments
feedback

Thinking in Java by Bruce Eckel


Comments from duplicate answers:

prash: Thinking in Java by Bruce Eckel is a great book for beginners and teaches you not only the "What"s and "How"s of Java but also the "Why"s. It is available from the above link.

Michael Easter: It is an introduction and yet discusses the background behind Generics, Swing, elementary threading, and a large metaphor for Java NIO. It is a massive work that covers the range from beginner to expert. There are other books that are better for experts but would be wasted on novices.

link|improve this answer
show 2 more comments
feedback

When it comes to multithreading, Java Concurrency in Practice is the choice.

link|improve this answer
3  
Brilliant brilliant book. I guess I'm considered something of a concurrency expert at my employer, yet every time I look in this book I go "wow, I didn't realise it worked like that". – Cowan Oct 1 '10 at 4:19
feedback

Head First Design Patterns - not necessarily a pure Java book, but essential for every Java developers who designs his applications himself.

link|improve this answer
2  
-1 on this one, sorry. Design patterns are better discovered than learned. – BlueRaja - Danny Pflughoeft May 18 '10 at 15:28
3  
@Jonik, yes - even those that learned patterns from the GoF book as this book teaches you how Design patterns are evolved and principles behind a pattern. It teaches you how to discover patterns instead of learning it. @BlueRaja... I agree and that's exactly the reason why I recommend this book. Too bad you haven't read it bevor voting down ;-) – Yaba May 26 '10 at 21:03
show 2 more comments
feedback

Java Puzzlers is another great one by Joshua Bloch (with Neal Gafter).

http://www.javapuzzlers.com/lg-puzzlers-cropped.jpg

The entire content of the book is just small Java applications that are quirky enough that they don't necessarily behave how you might immediately think.

link|improve this answer
1  
by J Bloch and N Gafter – Michael Easter Oct 3 '08 at 21:01
show 1 more comment
feedback

Head First Java is great for beginners.

Effective Java will take you from journeyman to master.

link|improve this answer
feedback

Refactoring by Martin Fowler

Especially the chapter about Bad Smells in Code should be understood by everyone.

link|improve this answer
feedback

Java Programming Language is a good way to learn Java. I would highly recommend it.

link|improve this answer
3  
This is the second best book after Effective Java (but one should read this at first). I don't understand why it got only one vote before my vote. This is the only book that could explain to me Java Generics. I wish I had discovered earlier. – zilupe Jun 2 '09 at 12:52
feedback

Core Java Vol 1 and Vol 2 by Cay S. Horstmann.

Hard to read but very informative and without excess words. These books cover every aspect in Java SE. But this book will be a little hard for beginners IMO.

link|improve this answer
show 1 more comment
feedback

O'Reilly's Java in a Nutshell is a good book for both tutorials and reference.

link|improve this answer
1  
This book only covers up to Java 5 so it might be a bit outdated as a reference. – Li Lo Sep 3 '09 at 21:38
show 1 more comment
feedback

Java Language Specification (also freely available online) is great if you want to get deeper into the semantics of Java language.

(Links and comments above merged from a duplicate answer by folone.)

link|improve this answer
show 1 more comment
feedback

Java Generics and Collections by Maurice Naftalin & Philip Wadler. Philip Wadler is one of Java generics grandfather. Java is close enough to C++ that it wasn't a big deal at all for me to switch over, that was until I started using Generics. This book is a gold mine of info.

link|improve this answer
show 1 more comment
feedback

Better, Faster, Lighter Java by Bruce A. Tate and Justin Gehtland

It's a really good one.

link|improve this answer
4  
It's good, but a little dated, I find. For example, the whole anti-EJB diatribe is a bit boring to read in 2008, since that debate was settled so long ago, now. To me, The Pragmatic Programmer's way of presenting principles and techniques is more timeless. – Mwanji Ezana Sep 16 '08 at 18:59
1  
+-0 I agree with Mwanji. The promise of the book (from the back cover or Amazon summary) seemed great. But for me, it didn't really deliver: nothing that new; examples not especially well thought out; not written in a very engaging manner (when compared to the best Java books I've read). – Jonik Apr 14 '09 at 16:13
feedback

Filthy Rich Clients, by Chet Haase and Romain Guy. Those guys are Swing ninjas.

link|improve this answer
feedback

If you want to understand, how it all works, The Java Virtual Machine Specification (also freely available online) is the book for you.

link|improve this answer
feedback

Everyone should read Effective Java once.
Thinking in Java is a good intro for transitioning programmers.

The best Java book I've read in the last 5 years was Java Concurrency in Practice by Brian Goetz

link|improve this answer
show 3 more comments
feedback

Sam's Teach Yourself Java 6 in 21 Days is a great book. Great for someone completely new to programming

link|improve this answer
1  
Why the down-vote? I'll bet someone got something good out of it. I think people slam these books "just because." – kirk.burleson Jul 22 '10 at 2:14
show 1 more comment
feedback

Learning Java has really helped me get up-to-speed.

And Hardcore Java is an incredible follow-on for intermediate Java developers.

link|improve this answer
show 1 more comment
feedback

Concurrent Programming in Java: Design Principles and Patterns by Doug Lea (2nd edition)

Concurrent Programming in Java

http://java.sun.com/docs/books/cp/

link|improve this answer
feedback

Nobody has mentioned Dietel & Dietel's How to Program Java . I love these books, especially for their exercises.

link|improve this answer
show 2 more comments
feedback

First edition of Effective Java and then the second edition, to see some of the ideas that changed over time.

link|improve this answer
show 1 more comment
feedback

Agile Java: Crafting Code with Test-Driven Development is what got me started on Test-Driven Development. It helped me a lot both learning TDD and Java at the same time.

link|improve this answer
feedback

Java Threads by Scott Oaks. An excellent introduction to this difficult but important topic.

link|improve this answer
feedback

Currently Reading through "Spring in Action" and so far it has a course set for one of my top java books.

link|improve this answer
feedback

Practical Java by Haggar. Very similar to Effective Java.

link|improve this answer
feedback

Java Web Services Architecture published in 2003 by Morgan Kaufman

link|improve this answer
feedback
1 2