• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package foo doesnot exist

 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam getting following error when iam trying to compile my code.

folder structure

java_home (is a directory)
-------> Serv1.java
-------> foo (which is a directory/pkg)
...>Person.java



My "Person.java" is compiled successfully. However iam getting some error when i try to compile Serv1.java. The error which iam getting is

"package foo doesnot exist"

Person.java

Serv1.java

 
Rufus Addis
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is basic SCJP stuff, nothing specific to do with SCWCD.

If you managed to get 93% in SCJP and can't resolve a relatively simple import / package issue then it does somewhat question the value of the SCJP certificate!

This is meant as a personal critism just a general mild dispair! If it's been a while since you studied SCJP, and you haven't used those skills since I suggest you take a few days out to refresh your knowledge before progressing on to SCWCD.

I can't really follow your sub-directory diagram as it got a bit mangled on my screen. However in essence.

Check your source files are in the correct sub-directory for their package names.
Check your classpath.
Check you are running javac from the correct sub-directory so that it can find the files relative to where it is being run from. i.e. if it needs to find the package foo, it needs to be run from the sub-directory that is the parent of foo!

Rufus.
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot Rufus for such a priceless suggesstion.....ofcourse which i never asked for......

I would have rather appreciated you replying to my question rather then applying your brain(Which i doubt you have or not). Again dont mind, but the amount of effort you applied in giving that rubbish answer, even if you appplied half of that in solving that question would have been great.
If it was so simple why couldnot you solve it...why cant you understand the situaion..why are you giving rubbish excuses......ofcourse whatever be the problem with your screen......
If you have common sense you can simply understand that......
So before questioning others ....question yourself....

Now let me come to the other point...Ofcourse i know the question i asked isn't that tough......But sometimes you miss even simple things. Ofcourse we are not doing any rocket science.....

But i would have appreciated you giving a proper answer rather than giving your suggestion.
I would like to suggest you that in future, you keep your suggestion safe in some bank.........THANKS A LOT.....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't agree more Anyway, check this thread, as the poster has a similar problem.
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks verre.....

it got solved....simple classpath issue....

For my friend who gave me priceless suggestion

its almost an year i took scjp, but to brush up things its better you start doing the application/program directly. If you stuck up, i personally like to post it or google it rather than going back to book.
SCJP helps you understand things better, no doubt in that but if its almost an year and you are slightly out of touch you may not find such simple things....But if you get some hint, it will hardly take 2 min to solve...afterall you know the thing.....


Verre..Please suggest guys like Ruffe's not to give such suggestion which are not helping anyone's cause...


Thanks verre.....
 
Rufus Addis
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for touching a raw nerve - I did mean to say "This isn't meant as a personal critism", but a slight typo changed the entire meaning.

There just seem to have been a lot of very similar basic compile errors of late.

I did try and give helpful suggestions after my initial rant and suggested you:

"Check your classpath."

Which you did and found the error!

I normally give helpful and considered replies, and will try and restrict my rants to just " :roll: " in the future.

Sorry!

Rufus.
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its ok Rufus....i might have over reacted a bit.....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maan Shenoy:
its ok Rufus....i might have over reacted a bit.....
Yeah, I would say so.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's keep cool, and help each other Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic