This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath

 
Chintu Singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classpath is disturbing me a lot
Can anybody help on the following text form K&B book.
Let's use the same directory structure and a different classpath:

Directory Structure



Command is :



In this case, what directories will be searched if the current directory is dirA?
How about if the current directory is root? How about if the current directory is
dirB? In this case, both paths in the classpath are absolute. It doesn't matter what
the current directory is; since absolute paths are specified the search results will
always be the same. Specifically, only dirC will be searched, regardless of the current
directory. The first path (/dirB) is invalid since dirB is not a direct subdirectory of
root, so dirB will never be searched. And, one more time, for emphasis, since dot (.)
is not in the classpath, the current directory will only be searched if it happens to be
described elsewhere in the classpath (in this case, dirC).

Please help.
 
K. Tsang
Bartender
Posts: 3348
12
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chintu Ji wrote:In this case, what directories will be searched if the current directory is dirA?
How about if the current directory is root? How about if the current directory is
dirB? In this case, both paths in the classpath are absolute. It doesn't matter what
the current directory is; since absolute paths are specified the search results will
always be the same. Specifically, only dirC will be searched, regardless of the current
directory. The first path (/dirB) is invalid since dirB is not a direct subdirectory of
root, so dirB will never be searched. And, one more time, for emphasis, since dot (.)
is not in the classpath, the current directory will only be searched if it happens to be
described elsewhere in the classpath (in this case, dirC).


Well what you described is correct. So how is it disturbing?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic