aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Classpath and Javac ....... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Classpath and Javac ......." Watch "Classpath and Javac ......." New topic
Author

Classpath and Javac .......

Jon Lee
Ranch Hand

Joined: Mar 04, 2005
Posts: 134
Given a directory tree like this:

test
.|-src
....|-project.java

when I run [javac -classpath .\src project.java] in the dir of test, it returned [error: cannot read: project.java 1 error]

Why can't javac find the project.java file??? Anyone can help??
[ August 05, 2006: Message edited by: Jon Lee ]

SCJP 5.0 - 98% (2007)<br />SCWCD 1.4 - 97% (2007)
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
Is this project.java in some package?

Naseem
[ August 05, 2006: Message edited by: Naseem Khan ]

Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Jon Lee
Ranch Hand

Joined: Mar 04, 2005
Posts: 134
No, there is no package definition in project.java.

Even if there is, it is not a concern of javac.

The problem here is that javac can not find the project.java file. It seems the classpath option has no effect....dont know why...
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
No, there is no package definition in project.java.

Even if there is, it is not a concern of javac.




project.java is in src, so compile it from src directory.

Naseem
[ August 05, 2006: Message edited by: Naseem Khan ]
Jon Lee
Ranch Hand

Joined: Mar 04, 2005
Posts: 134
Now I know why.

classpath option is for searching the .class files, not the .java file...

Thnx for your comments, mate...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath and Javac .......