What is wrong with package statement?

Dear all,

I have a very strange problem with my classes. In two classes, I used

pakage saxbean;

in the first line of the code to specify that the two classes are in the same package named saxbean. However, one class can be compiled without any problem,the other one always gave error messages:

can't resolve symbol...

My classes in this case are

1. MyElement.java and 2. MySAXParserBean.java

where 2 use 1. when I tried to compile 2, then the error messages came saying:

can't resolve symbol MeElement

location: saxbean.MySAXParserBean.java

even though there is a class called MyElement.class in the same directory.

?

Any idea, anyone?

BTW: no problems with other programs if using pakage statement. And the enviroment settings should be fine.

I was despressed by it :(

[871 byte] By [Ilikejava] at [2007-9-26 4:08:46]
# 1
"can't resolve symbol MeElement"Is that a typo?Try deleting the other class file and recompiling. The source files should be in a directory called saxbean and you should be compiling from its parent directory with javac saxbean/MyElement.java.
jsalonen at 2007-6-29 13:11:14 > top of Java-index,Archived Forums,Java Programming...
# 2

> My classes in this case are

> 1. MyElement.java and 2. MySAXParserBean.java

> where 2 use 1. when I tried to compile 2, then the

> error messages came saying:

> can't resolve symbol MeElement

> location: saxbean.MySAXParserBean.java

> even though there is a class called MyElement.class in

> the same directory.

> ?

Hi,

from what I can read here your class is called MyElement, and the error message says MeElement. If you have not done a typo here - that is the problem. You are trying to use a class called MeElement, when the real name is MyElement.

//Anders ;-D

anders.hedstrom at 2007-6-29 13:11:14 > top of Java-index,Archived Forums,Java Programming...
# 3
Oh sorry, the error message is:can't resolve symbol: MyElementThe source files are in a directory called saxbean and the class MyElement.java can be complied successfully, but it's not the case for the other class.Thanks you.
Ilikejava at 2007-6-29 13:11:14 > top of Java-index,Archived Forums,Java Programming...
# 4
Mail me your two source files, and I will have a look right away....java@anders.tc
anders.hedstrom at 2007-6-29 13:11:14 > top of Java-index,Archived Forums,Java Programming...
# 5
Give us your classpath and commandline... And remember: even if the other class was compiled successfully it doesn't mean that it was compiled correctly. You need to compile both classes from the parent directory, so delete the class files that you have now.
jsalonen at 2007-6-29 13:11:14 > top of Java-index,Archived Forums,Java Programming...