Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


LaTeX source for Think Java, 2nd edition. Copyright (c) 2020 Allen B. Downey and Chris Mayfield. This edition was published in December 2019 by O'Reilly Media (ISBN 9781492072508).

Permission is granted to copy, distribute, and/or modify this work under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, which is available at

The original form of this book is the LaTeX source code available from and

The illustrations were drawn using xfig ( and dia ( These tools are free and open-source.

Compiling the LaTeX source has the effect of generating a device-independent representation of the book, which can be converted to other formats and printed.

To compile the PDF version from source:

pdflatex thinkjava2.tex
pdflatex thinkjava2.tex
pdflatex thinkjava2.tex

The source code includes a Makefile that automates this process. On Linux, you may need to install texlive-latex-extra and texlive-fonts-recommended.

To build the HTML versions, the hevea package is required. Use the Makefile as follows:

make hevea    # static html
make trinket  # interactive