• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between a source file and a class file

 
K Ville
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm quite confused with the use of javac -sourcepath and javac -classpath. What makes the difference?
 
Igor Ko
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sourcepath - where to find sources files, with text
of java program.
Class path - in your sources you can use already compiled classes
(for example your friend wrote some class but you don't have
his source text, but only compiled version .class), if you
wish to use the class in your program, compiler should check
signature of functions (it likes h file in C/C++)),
so you should set classpath to point such files.
[ December 22, 2003: Message edited by: Igor Ko ]
 
K Ville
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic