• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

The file is there. Where is Java looking?  RSS feed

 
Ranch Hand
Posts: 110
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,
Please, have a look at the image and tell me what's different between what I think I see and what Java sees.
packaging.PNG
[Thumbnail for packaging.PNG]
packaging
 
Marshal
Posts: 6008
415
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of your problems is, that you didn't import Foo class in class Bar. Fix that and see how goes further.
 
Biniman Idugboe
Ranch Hand
Posts: 110
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thanks a lot. I never knew the import statement could influence the classpath so much.
import-statement.PNG
[Thumbnail for import-statement.PNG]
missing import statement
 
Marshal
Posts: 60142
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please always tell us where such images come from, to avoid copyright problems. In future, please don't post such images: post their text instead.

You are mistaken that import declarations affect the classpath. It is the other way round. The classpath determines which imports are available.
 
Biniman Idugboe
Ranch Hand
Posts: 110
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The images are mine.  I created them just to explain my points.

The classpath determines which imports are available.


The import statement exists before the classpath option is defined.  No offense. Could you explain what you mean.
 
Sheriff
Posts: 5124
138
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Biniman Idugboe wrote:

The classpath determines which imports are available.


The import statement exists before the classpath option is defined.  No offense. Could you explain what you mean.


Well sure, but they aren't in effect until you compile the source.  The import statement is just a shortcut that lets you write Foo instead of net.snortum.foomaker.Foo.  The classpath tells the compiler where to find net.snortum.foomaker.Foo.
 
Biniman Idugboe
Ranch Hand
Posts: 110
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a goat herder who just happen to have one cow.  Thanks for the explanation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!