• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Biniman Idugboe
Ranch Hand
Posts: 42
1
  • 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
 
Liutauras Vilda
Sheriff
Posts: 4928
334
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: 42
1
  • 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
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • 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: 42
1
  • 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.
 
Knute Snortum
Sheriff
Posts: 4287
127
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: 42
1
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!