• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javac question from book unclear

 
Mirka Ignjatovic
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chapter 10, question 10.

cd /foo
javac -classpath /foo/bar/biz/bing:/foo/bar MyClass.java

answer: Java file will be found in /foo/bar/biz/bing

What do classpath has with location og Java file?
Is it only for looking for class files that MyClass.java needs?
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mirka,

The question is "Which version will be used by javac" so the first hit will be used. /foo/bar/baz/bing is the first hit so it will be used.

Remember: javac searches the current directory by default.

Regards ...

Vassili ...
 
Mirka Ignjatovic
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question was, what -classpath has to do with searching for *.java files
classpath = "path of *.class"
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mirka mirka:
Chapter 10, question 10...

Do you have a specific book in mind?
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "mirka mirka"-

Welcome to JavaRanch.

On your way in you may have missed that we have a JavaRanch Naming Policy for displayed (screen) names. Your displayed name must consist of a first name (or an initial), a space, and a family name (in that order) and not be obviously fictitious. Since yours "mirka mirka", does not conform with it, please take a moment to change it, which you can do right here.

Posters with nonconforming displayed names will be locked out of JavaRanch after a few posts using those names.

Thanks
-Barry

(NR) - search tag
 
Mirka Ignjatovic
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, name changed.
Book is SCJP study guide exam 310-055 from K&B.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic