wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes about packege Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about packege" Watch "about packege" New topic

about packege

popoe shi

Joined: Sep 14, 2003
Posts: 10
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??
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
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...
jQuery in Action, 2nd edition
subject: about packege
Similar Threads
java lang
writing file
Error when Stopping server
Writing data to a file
How to get the list of class names accessed