I believe I have found an error in one of the review questions for Chapter 1. According to the answer to question #14, "The jar command allows the use of the classpath, making option C correct." However, when I type "jar --help" in the command prompt I do not get -cp as one of the available options. Also, I do not understand how -cp could be potentially useful for the jar command. I'm not a Java expert and would be grateful if someone could clear this up for me.
Thank you for giving the book's authors; that makes it much easier to identify the book. Please supply more details of the question for those of us who don't have that book.
What do you know about jars? Have you been through the Java™ Tutorials? Maybe the bit about classpath refers to the manifest file's contents.
Table 1.5 shows the options you need to know for the jar command.. -cp is not in that list. (And as you note, it doesn't exist.) When I wrote the question, i was thinking of the Jar manifest which allows a classpath. But that's not on the exam and it certianly isn't the -cp flag. I've logged this an errata and given you credit.
Thank you for the warm welcome, guys.
Thank you for the link, Jeanne. It never occurred to me that jar files could reference each other.
By the way, I also found a small typo in Table 2.2 Reserved words. Short begins with an uppercase S instead of lowercase. Not sure if such typos are worth mentioning, though.
Everything is worth mentioning. We maintain two lists. The public errata is everything that is actually wrong. (Short vs short is wrong). We also have a private list of things that aren't wrong but could be clearer. We kept track of *everything* people said about the Java 8 books and considered it when writing the Java 11 versions. It's like programming. You want to regression test so you don't the same errors!
This particular one is interesting. It was correct in the OCA 8 book. It was correct in our first draft and after our technical editor saw it. It was wrong in the next phase of rendering. So I think someone's Word was "helpful" and "corrected" it to something that was wrong.
Jeanne, I found another typo.
It is in Chapter 2, section "Initializing variables". The paragraph beginning with "Believe it or not...".
The second sentence begins with "Java is not case sensitive...". Should be replaced with "Java is case sensitive...".
I'm using the Kindle edition, so, unfortunately, I can't point you to the exact page.
By the way, is it okay if I keep posting in this thread?
posted 1 year ago
Not something important, but I think it might be better to start a new thread for each error. Other people might have different opinions.
If that error about “not case sensitive” is on page 57, it has been noticed already.