File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "classpath" Watch "classpath" New topic
Author

classpath

Chintu Singh
Greenhorn

Joined: May 08, 2013
Posts: 20
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.


OCPJP
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2366
    
    7

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?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath