Download

What is this stuff?

This is the examples from Ian's Java Cookbook, Third Edition, and a bunch of other Java demonstration programs. In short: Java code, lots of it.

The current source code is in javasrc on GitHub.com.. You can "git clone" if you want updates, or download a single archive if you don't. For some lighter fare, you can also view individual files on that web link.

What am I allowed do with this stuff?

Pretty much anything, except claim that you wrote it.

O'Reilly's general policy is: "You can use and redistribute example code from our books for any non-commercial purpose (and most commercial purposes) as long as you acknowledge their source and authorship. The origin of the code should be noted in any documentation as well as in the program code itself (as a comment). The attribution should include author, title, publisher and ISBN..." All the code I wrote is under the BSD license which is even more liberal. You definitely may use this code in any way including commercial projects, as many people have. You do not have to ask me every time. In fact, please do not ask me; I am busy enough that I am quite likely to ignore such queries. Read more on the O'Reilly Web Site.

I do ask that you credit me as the original source of the material. The following should suffice:

The Original Author of this code is Ian Darwin, http://www.darwinsys.com/.
Some code from the O'Reilly Java Cookbook, Second Edition,
ISBN-10: 0-596-00701-9 | ISBN-13: 9780596007010

I would also appreciate, as a matter of courtesy, that you notify me if you use this code in any published papers (academic or otherwise). Thank you.

Problems?

To those who doubt that the current version builds, I offer the following log of downloading and building the entire 'javasrc' sourcecode, from scratch, in a clean directory, as of mid-2013.

This code requires Java SE 8 (JDK 1.8) or later. If you want to use older versions of Java, some files will not compile; just remove them or add to the "exclude from compilation" list.

If you have other questions, please read the FAQ (Frequently Asked Questions) and the Errata Pages (at the O'Reilly site).

Department of Antiquities

Older editions of the code may be found at e.g., http://examples.oreilly.com/9780596007010/. For convenience they are mirrored here:

  • Crufty old code - Java Cookbook 2
  • Even cruftier older code - Java Cookbook 1
  • Version of darwinsys-api for JCB 1e
  • Use at own risk. You are better off using the newer stuff above and cutting out what doesn't work; the newest of these antiquities misses a full decade of my learning about better ways of doing Java.