Collected code examples from the O'Reilly Java Cookbook 3d Edn
Java HTML C Makefile JavaScript Shell Other
Switch branches/tags
Nothing to show
Clone or download
Failed to load latest commit information.
.settings auto-generated-file Sep 4, 2015
images How to compile the JavaFX files on Java 8 on a Mac. Feb 24, 2017
lib Remove obsolete. Aug 9, 2014
sampleproject/maven Simple sample projects, initially just Maven. Jan 10, 2014
scripts Single place for scripts to run some of these programs. Jan 2, 2014
src Sync, but going away from here soon Jul 16, 2018
template de-dross Oct 3, 2016
.classpath Sync .classpath Jan 26, 2018
.gitignore Add Spring Framework for DI example; ignore SimpleHttpServerSE Nov 9, 2013
.project Jboss plugin mega-rewrite Dec 4, 2015
Copyright.html Tweak MkIndex. Jan 21, 2014
DISCLAIMER.txt Needed Dec 29, 2013
LICENSE.txt Copyright date Dec 10, 2016
README-mac-jfx.html Unbreak HTML Feb 24, 2017
README.adoc sync Aug 9, 2014
TODO.txt sync Mar 2, 2014
index-bychapter.html De-linting Oct 3, 2016
index-byname.html Tweak script and re-run it, regen index-byname using non-leading-"." … Jul 22, 2017
index.html Commit a large variety of stuff, most of it cleanups brought on by st… Apr 3, 2007
lines.txt Show line-mode for Java8+. Rename poorly-named dummy data file, synch. Jul 22, 2017
makeIndexByName Tweak script and re-run it, regen index-byname using non-leading-"." … Jul 22, 2017
pom.xml mvn versions:use-latest-versions; adjust jdom imports; drop repo and … Apr 15, 2018
run_cdi_demo Script to run the CDI DI SE demo. Dec 27, 2013
stylesheet.css ArrayList: deprecation in comment. Miles2Kms: modernize, barely usable. Sep 14, 2002


JavaCook Source Files (javasrc)

  • You MUST HAVE Java 8 to successfully compile this whole package.

  • Building with Eclipse tested with Eclipse 4.3; MUST HAVE "m2e" (free in the Eclipse Marketplace) Compiles and most tests pass; those with Hamcrest fail for me due to an obscure conflict: java.lang.SecurityException: class "org.hamcrest.Matchers"'s signer information does not match signer information of other classes in the same package

  • Building with Maven 3.x works and all tests pass.

  • Building with other platforms? Good luck, but let me know if it works.

    1. This is now built for Java 8. Sorry if you are on some relic platform that doesn’t have Java 8 or some environment in which Java 8 is not yet "approved", but the world has moved on; Java 6 is a relic, is deprecated, and has been EOL’d by Oracle. "He’s dead, Jim." Java 7 is on life support; Java 8 is current. I have updated the Java Cookbook for Java 8 and these files are the examples for that book. You might be able to compile for Java 7 with a large excludes list, but you’re on your own if you do that. "Always in motion the Java is."

    2. This project has been reorganized so that the source is in the subdirectory src/main/java, where most modern tools including Maven, Gradle, and others, expect them to be.

    3. The Java files are in Java packages whose name corresponds to the directory they are in (this is how most tools including Ant and Eclipse expect to find things).

    4. The index-bychapter file is substantially out of date since the packagification "flag day". index-byname.html is reasonably up-to-date.

    5. I am using Eclipse for most of my development, and Maven for building, and Jenkins for automated building. Any Ant scripts you find are out of date and unsupported! If you happen to get them working and want them to stick around, please send me a pull request against the git repo.

    6. An unspecified number of files here are used in the Java Cookbook. Those that have been converted to the newest publishing software at O’Reilly will have "// BEGIN" and "// END" comments to mark sections for mechanical inclusion into the book. These are just comments and can be completely ignored by people looking at the source code normally. Not all files with these comments necessarily appear in the book.

Ian Darwin

Java Cookbook author