The examples are freely available at https://github.com/BruceEckel/OnJava8-Examples.
On Java 8 is only available as an eBook, and only via Google Play Books. Any other source or delivery mechanism is illegitimate.
This book is far too large to publish as a single print volume, and my intent has always been to only publish it as an eBook. Color syntax highlighting for code listings is, alone, worth the cost of admission. Searchability, font resizing or text-to-voice for the vision-impaired, the fact you can always keep it with you---there are so many benefits to eBooks it's hard to name them all.
Anyone buying this book needs a computer to run the programs and write code, and the eBook reads nicely on a computer (I was also surprised to discover that it even reads tolerably well on a phone). However, the best reading experience is on a tablet computer. Tablets are inexpensive enough you can now buy one for less than you'd pay for an equivalent print version of this book (which, note, does not exist). It's much easier to read a tablet in bed (for example) than trying to manage the pages of a physical book, especially one this big. When working at your computer, you don't have to hold the pages open when using a tablet at your side. It might feel different at first, but I think you'll find the benefits far outweigh the discomfort of adapting.
I've done the research, and Google Play Books provides a very nice reading experience on every platform, including Linux and iOS devices. As an experiment, I've decided to try publishing exclusively through Google Books.
The free sample includes a complete table of contents.