N
Novice
I'm having a problem compiling some Java code which I _think_ has to do
with a dependency issue that I don't fully understand. I wonder if someone
here can enlighten me?
I have a class named FooApplet which is defined as public and extends
JApplet. FooApplet makes use of a class I wrote called WrapUtils, which is
simply a public class. WrapUtils in turn makes use of other classes I wrote
called ErrorUtils and CountUtils, both of which are simply public classes.
I'm using Eclipse 3.7 and FooApplet compiles just fine. However, WrapUtils
shows compile errors at every mention of ErrorUtils and CountUtils.
ErrorUtils and CountUtils both compile cleanly.
The suggested fixes for the errors in WrapUtils include generating an
import statement for ErrorUtils and CountUtils, even though they are in the
same package as WrapUtils. When I click on the option to generate those
imports, the import statement is NOT added to WrapUtils and the errors for
ErrorUtils and CountUtils remain. The red "x" remains on WrapUtils both in
the editor and in Package Explorer. Why does Eclipse not see the ErrorUtils
and CountUtils? All of the classes are public and all of WrapUtils,
CountUtils and ErrorUtils are in the same package, although it is a
different package than the one containing FooApplet?
So, to recap, we have:
com.foo.FooApplet (public extends JApplet)
- invokes com.foo.utilities.WrapUtils (public)
- invokes com.foo.utilities.CountUtils (public)
- invokes com.foo.utilities.ErrorUtils (public)
All references to CountUtils and ErrorUtils in WrapUtils are flagged as
compile errors: "CountUtils cannot be resolved".
What stupid mistake am I making? Is this a dependency error? Or is the fact
that the methods in WrapUtils, CountUtils and ErrorUtils are all static
that are the source of the problem?
with a dependency issue that I don't fully understand. I wonder if someone
here can enlighten me?
I have a class named FooApplet which is defined as public and extends
JApplet. FooApplet makes use of a class I wrote called WrapUtils, which is
simply a public class. WrapUtils in turn makes use of other classes I wrote
called ErrorUtils and CountUtils, both of which are simply public classes.
I'm using Eclipse 3.7 and FooApplet compiles just fine. However, WrapUtils
shows compile errors at every mention of ErrorUtils and CountUtils.
ErrorUtils and CountUtils both compile cleanly.
The suggested fixes for the errors in WrapUtils include generating an
import statement for ErrorUtils and CountUtils, even though they are in the
same package as WrapUtils. When I click on the option to generate those
imports, the import statement is NOT added to WrapUtils and the errors for
ErrorUtils and CountUtils remain. The red "x" remains on WrapUtils both in
the editor and in Package Explorer. Why does Eclipse not see the ErrorUtils
and CountUtils? All of the classes are public and all of WrapUtils,
CountUtils and ErrorUtils are in the same package, although it is a
different package than the one containing FooApplet?
So, to recap, we have:
com.foo.FooApplet (public extends JApplet)
- invokes com.foo.utilities.WrapUtils (public)
- invokes com.foo.utilities.CountUtils (public)
- invokes com.foo.utilities.ErrorUtils (public)
All references to CountUtils and ErrorUtils in WrapUtils are flagged as
compile errors: "CountUtils cannot be resolved".
What stupid mistake am I making? Is this a dependency error? Or is the fact
that the methods in WrapUtils, CountUtils and ErrorUtils are all static
that are the source of the problem?