• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

K&B SCJP 6 Chapter 10 question 11.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On p798, in the first paragraph after 'Exam Watch' there are these two sentences :-
"When searching for class files, the java and javac commands don't search the current directory by default. You must tell them to search there."

I found this borne out by the correct answers (C and F) to self-test question no. 9 at the end of chapter 10.

However it appears to be directly contradicted by the correct answer (given as A), to self-test question no 11 (also chapter 10).
The second part of answer A is :-
java GetJar
I would have thought this needed to be :-
java -cp . GetJar

(This is made more unclear in that on my machine, a Windows box, with Windows XP, I have never had to use the classpath option when running java, and this despite the fact that 'echo %PATH%' shows no sign of the fullstop (for current directory) character.

I am deeply discombobulated. Am I making some silly mistake here?

Thanks in advance for any help.

 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Simon Forth,

Perhaps this might help you.
 
Simon Forth
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anayonkar Shivalkar,

I believe that has answered the question for me.

Thank you very much indeed for your help.

Simon Forth.
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are welcome
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic