aspose file tools*
The moose likes Beginning Java and the fly likes Classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Classpath " Watch "Classpath " New topic
Author

Classpath

Ferwed Kondos
Greenhorn

Joined: Sep 27, 2007
Posts: 6
I have the following 2 files in these 2 packages:

Now I want to compile class Child, consider these 2 packages are contained in a directory called "Test" I simply do this in command line:
cd Test
javac pack2\Child.java

My question, shouldn't I be using -classpath option to locate Parent.java during compilation, same when running to locate Parent.class.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Ferwed Kondos:
...shouldn't I be using -classpath option to locate Parent.java during compilation, same when running to locate Parent.class.

If no classpath is specified, Java's default is to look in the current directory. Since this is where pack1.Parent is located, it should work without explicitly specifying a classpath.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath