Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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

migration rejected from stackoverflow.com Mar 23 at 19:30

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

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

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

16 Answers 16

up vote 339 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.

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
"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
+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
@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

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.


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

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

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

-1 on this one, sorry. Design patterns are better discovered than learned. –  BlueRaja - Danny Pflughoeft May 18 '10 at 15:28
@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

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


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.

by J Bloch and N Gafter –  Michael Easter Oct 3 '08 at 21:01

Head First Java is great for beginners.

Effective Java will take you from journeyman to master.


Refactoring by Martin Fowler

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


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

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

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.


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

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

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.)


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.


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

It's a really good one.

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
+-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

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


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