Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

javac question from book unclear

 
Greenhorn
Posts: 6
  • 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?
 
Ranch Hand
Posts: 1585
  • 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
  • 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"
 
Sheriff
Posts: 11343
Mac Safari Java
  • 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?
 
Ranch Hand
Posts: 7729
  • 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
  • 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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic