• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

about packege

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello~~
I write two java file(call file A and file B) in the same package.
Those files all hava define "package userbean;"
In file B the content have write "new A()".
When I complie B file,it has error,and show "connot resolve symbol symbol:class A location:class userbean.B"
Please tell me why??
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Popoe
It might be the common issue with packages faced by all beginner.
If you have a directory called "userbean" and A.java and B.java in it then you should go out of the userbean directory first and then compile the classes in userbean directory like,
1. if you are on windows and having "userbean" in C: then,
C:>javac -classpath %CLASSPATH%;. userbean\*.java
2. if you are on unix/linux using bash shell then,
bash$javac -classpath $CLASSPATH:. userbean/*.java
that should work.
Note that here I try to address possible classpath issue you might face while trying to compile things from "outside the userbean" directory...
Regards
Maulin
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic