Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search

Free Electronic Book: Thinking in Java, 3rd Edition

(If you want the 4th edition, go here instead)

Purchase a signed copy of this book

Download here | Translations in Print | Why do you put your books on the web? | Nice Comments from Readers | Release Notes | Electronic Translations | Your Java Programming Questions | Discounts, Professor & Review Copies | Electronic book format | Source code for the book | Unzipping tools | Is it still free? | Submitting corrections |

Thinking in Java, 3rd Edition, wins the Jolt Award. Here's the press release.

Published by Prentice-Hall, December 2002

Purchase printed version of the 3rd edition from

Purchase printed version of the 3rd edition from Barnes and Noble

Purchase printed version of the 3rd edition from

Purchase printed version of the 3rd edition from SoftPro

View Prentice Hall Page on this book

For bulk orders if you are a corporation, association, training company, consultant, or state and local government facility, click here to find your sales rep.

If you want the 1st edition of this book instead, click here. Otherwise, keep reading...

This book was finished November, 2002

Click here for nice comments from readers

This page apparently has both "Thinking in Java" and "Thinking in C++" as being reader's choices for best book of 2002. I don't know which readers, other than that they are Chinese.

Animation by Nikhil Adnani from a drawing by Bruce Eckel
Java World Reader's Choice Award Java World Editor's Choice Finalist The Mining Company's 'Focus on Java' Best of the Net Award

Subscribe to the free OOP Newsletter from Bruce Eckel

Subscribing to the newsletter provides automatic notification when the book is revised and information about CD Roms and Java Seminars and workshops.

Your Java programming questions

Back to Contents

As many of you have noticed, I am terribly swamped with email and am unable to answer programming questions. There are several people who have kindly offered to answer Java questions that you would normally send to me. Click Here for details.

Electronic Book Format

I have done quite a bit of work to create a nice version of the book in HTML, including the diagrams, preservation of most of the formatting, nice fonts, and color syntax highlighting on the code files. I think you'll find it quite pleasant, especially the ease of use of the table of contents and index.

I'm using RTF2HTML (you can download a demo of that program) which does quite a good job of performing the conversion, making a table of contents and index, breaking up into files, etc. After that I run a Python program that I created to clean everything up and customize it to my liking.

When you go to the download site, you'll see a group of files with "TIJ2" and "HTML" in their names — those are the ones to download. If you unzip it on a Unix/Linux machine, make sure you use the -a flag to correct for newlines.

Source code for Thinking in Java 3rd edition

Back to Contents

Steps for installing source code on your machine:

  1. Go to the download site and download the file titled Thinking in Java, 3rd Edition by clicking on this link and requesting that your browser save the file.
  2. Unzip the files into your directory. This will create a directory called "aaa-TIJ3-distribution" and extract into it two more zip files:
    Unzip the file into the directory of your choice, which we'll call code. This will automatically create all the necessary subdirectories and install the files into code.
  3. Set your CLASSPATH variable to include '.' (the current directory) and the code directory.
  4. Now you can use Sun's JDK to compile and run the files. You can also automatically compile all the files using ant (see below).
  5. To compile some of the files, you will need to have additional Java libraries installed -- you are warned about this by messages emitted from the ant buildfile.

Please note that these files were tested with the most recent version of Java. Many files will compile with earlier versions of Java, but some will not.

Using "ant" to compile the files

We have created ant buildfiles for the code in Thinking in Java, 3rd edition. ant is an open-source, defacto standard tool that you can freely download from

Note: using ant is completely optional. You can just compile the programs by hand if you don't have ant.

If you have ant installed, you can go to the root of the directory where you installed the code and just type


This invokes javac on the files, one at a time, checking for the existence and the date of the .class file in each case. It also runs the programs and/or their unit tests. You can also type ant in each subdirectory.

Unzipping tools

Back to Contents

To unzip "zip" files, you can download an open-source tool at This is a freeware, open-source implementation of zipping and unzipping programs that work on virtually all platforms. It's also what I use to zip the files. Note that this software is also distributed on the CD ROM that comes with the book, under the Info-Zip subdirectory.

If you are unzipping onto a Linux/Unix platform, remember to use the -a flag to force it to correct ASCII files; otherwise you'll get strange results.

Is it still free?

Back to Contents

The electronic version of the book will continue to be free. You have permission to print a copy of the book for your own use, and to distribute the unmodified electronic version(s).

If you like the book, please:

  1. Recommend it to your friends.
  2. Create links to this site from your web page or mirror this page.
  3. Report any errors or problems you find.
  4. Consider buying a copy of the printed book - it's probably cheaper than the toner cartridge you'll use up printing it yourself. However, if it works well enough for you as an electronic document, great!
  5. Consider buying a CD Rom or coming to one of my seminars.

Printed book discounts, review copies, professor copies

Back to Contents

For discounts on orders of greater than 10 copies, call: Mike Nicholson at 201-236-7149 (FAX 201-236-7141) or email

Qualified reviewers should contact Stephanie Sas at Prentice-Hall: 201-236-7119 for review copies.

Professors can go to their normal Prentice-Hall representative and request a sample, or call Faculty Services at 1-800-526-0485, or request a sample from the web site

Submitting corrections

Back to Contents

Please note: Please only use the feedback system built in to the HTML version of the book (that's the electronic version that you can freely download). Each paragraph is followed by a URL, which generates an email message about that paragraph which will arrive in MindView's BackTalk system for this book.

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.