I've just started working on Learning Java, 4th Edition. On page 28 I am advised to go to the O'Reilly web site and down load "examples-eclipse.zip". It is not there. The download link takes me to GitHub where only the non-eclipse version, "examples.zip" is shown.
This is not rocket science! If you direct your reader to a download, the first task in using the book, for crying out loud, and you take no care to see that the file can be had, what other quality gates have you missed!
I apologize for you frustration concerning this. I think I might have found what you are looking for: https://github.com/patniemeyer/learni.... If this is not helpful please let me know and I'll be happy to forward this on to one of our book techs.
Customer Service Representative
I downloaded the file and imported it per the book's instructions. I got this error message:
Failed to load JavaHL Library.
These are the errors that were encountered:
no libsvnjavahl-1 in java.library.path
no svnjavahl-1 in java.library.path
no svnjavahl in java.library.path
java.library.path = .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
I have forwarded your question on to our Book Tech staff, so they can help you find a solution. If you ever have any questions or issues with the content of a title, you can also contact them directly at firstname.lastname@example.org or call them at:
1-707-827-7019 (outside the USA)
7:30 am to 5:00 PST
Customer Service Representative
This reply was removed on 2013-09-12.
see the change log
PROBLEM SOLVED, FIX BELOW!
The archive you need is IN the archive that you download from the main page.
When you click "Download Zip" you get a file names "learningjava-master.zip".
Unzip that file, then open the folder and navigate to:
learningjava-master -> examples -> eclipse project -> examples-eclipse-ch2.zip
Even though it has a "ch2" on the end, it has the complete project. (I think they just put it there so that any reasonable person would NOT think to look at it...)
To get the examples working, follow these steps.
(Ignore the steps in the book--they are wrong, wrong, wrong!) This works with the latest version of Eclipse: Kepler.
1) Go to http://oreil.ly/ Java_4E, click on Download Sample Code, which takes you to a github page, then click Download Zip and save the file to your Desktop (or other convenient place.
2) The file you downloaded is named "learningjava-master.zip", extract that and you will get a directory names "learningjava-master". The zip file you really need is buried deep in there...
3) Open Eclipse
4) Go to File -> Import (don't create a project--you are importing one)
5) Expand General and select "Existing Projects into Workspace" and click "Next"
6) Choose "Select Archive File" and browse to learningjava-master -> examples -> eclipse project -> examples-eclipse-ch2.zip; select OK
7) Click Finish
Your project with example code has been imported to Eclipse and the examples run!
So, if you remember the instructions are wrong, the file name is wrong and the codes is not where you expect it to be and the name makes no sense... you will do just fine!
That's good. But with Mac it's gets a little more complicated. First you have to locate and install the Xcode app, then you have to locate and install the command-line tools for Xcode (Why, oh Apple, aren't these included in the Xcode package?), then you have to locate and install the MacPorts libraries, ....
I always feel like Groucho Marx trying to bet on the horse race in "A Day at the Races".
Now I can load all of the packages in the ZIP file without getting a complaint about the JavaHL library having gone AWOL. I still see errors flagged in later chapters with notes about missing components, but I'll fight that battle another day.
"Getta you tootsi frootsi icea cream."
The author responded to a thread similar to this one, so I figured I would add his response here:
Hi, I am Pat Niemeyer, the author of Learning Java. I apologize for the trouble many of you have had in installing the example code. The problem is that the book contains two competing sets of directions for importing the examples into Eclipse -- One set of instructions in chapter 2 and another set of instructions in Appendix A. (The difference is that one set expects a zip file containing a top level source directory and one does not.)
To resolve this, shortly after the book was published I updated github with *two* zip downloads -- one named examples-eclipse-ch2.zip for readers using the instructions in chapter 2 and one named examples-eclipse-appa.zip for readers following the instructions in appendix A. If you choose the appropriate zip file it will work with the instructions provided in the respective chapter.
Both zip files contain all of the example code used in the book. The only difference is the packaging. I am updating the README file to clarify this.
Alternately, you may wish to read through the Eclipse tutorial in Appendix A first to learn how to create a project and then simply browser the source on github and copy & paste individual examples into files as needed.
Again, I apologize for any frustration this has caused and the problem will be resolved in the next edition.
Here is the README.txt in the examples-eclipse directory on github.
This directory contains two identical copies of the full Learning Java source code, packaged for eclipse in different ways. If you are following the instructions in Chapter 2 please choose the "examples-eclipse-ch2.zip" file. If you are following the instructions in Appendix A please choose "examples-eclipse-appa.zip".
The difference is that the Appendix A version contains a top level "Learning Java" folder and the Chapter 2 version has the contents at the top level of the zip file. We apologize for the necessity of the two versions; the loading instructions in each chapter are slightly different and will be reconciled in a future update.
examples-eclipse-ch2.zip -- Full source code for the book Learning Java. Use this file if following the installation instructions in Chapter 2.
examples-eclipse-appa.zip -- Full source code for the book Learning Java. Use this file if following the installation instructions in Appendix A.
So hold on this problem has been around since the book has come out and I have to google it to find a forum thread that leads me to a site to download it, but I must download something from the site to download what I want that a whole year after realizing the problem oreilly has not resolved this issue. So anyone who purchased the book and didn't find this thread which has no correlation to the book other than the publisher would have to go through this hassle to use something they paid fifty plus dollars for so another site can resolve the issue and oreilly take credit while doing nothing? Why must I download github to use my oreilly book that directs me to an oreilly url that does not exist?
So sorry for your frustration. The download code is linked from the catalog page the book on oreilly.com here: http://shop.oreilly.com/product/06369.... Again, sorry for any frustration that this has cause you.
Customer Service Representative