• 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

Classpath and Javac .......

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this project.java in some package?

Naseem
[ August 05, 2006: Message edited by: Naseem Khan ]
 
Jon Lee
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I know why.

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

Thnx for your comments, mate...
 
reply
    Bookmark Topic Watch Topic
  • New Topic