I also used to think it mattered, but rapidly discovered I never even detached the CDs from the back of the book, let alone loaded them up.
The only book I’ve bought that came with a CD that I’ve bothered using was The Blender Book, a book about the free 3D modeller Blender. I used the CD because it contained a load of textures, lots of different versions of Blender, a load of finished renders and all the scenes used in the examples. For an application book that’s invaluable.
When it comes down to Java programming, there’s very little on that scale that would be useful - you could bundle a JDK and the examples with it, but as Leknor says the examples aren’t usually very big anyway. Any JDK you bundle will be out of date very fast - don’t count on a bundled JDK and JavaDocs to be current for more than a month after publication. IDEs are a very personal choice - give people one option and they’ll hate it, give people a wide range and they’ll hate having to choose! :
I find it hard to think of a really good reason for including a CD with a Java programming book, aside from the advertising value of it. If the cost isn’t too much and it’ll boost sales then yeah, go for it. Don’t expect the reader to find much use in it though!