Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9298

Compile Problem involving Dependencies

From Novice <novice@example..com>
Newsgroups comp.lang.java.programmer
Subject Compile Problem involving Dependencies
Date 2011-10-29 17:06 +0000
Organization Your Company
Message-ID <Xns9F8D860F77952jpnasty@94.75.214.39> (permalink)

Show all headers | View raw


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?

-- 
Novice

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar


Thread

Compile Problem involving Dependencies Novice <novice@example..com> - 2011-10-29 17:06 +0000
  Re: Compile Problem involving Dependencies markspace <-@.> - 2011-10-29 10:18 -0700
    Re: Compile Problem involving Dependencies Novice <novice@example..com> - 2011-10-29 17:29 +0000
      Re: Compile Problem involving Dependencies markspace <-@.> - 2011-10-29 12:32 -0700
        Re: Compile Problem involving Dependencies Lew <lewbloch@gmail.com> - 2011-10-29 17:06 -0700
          Re: Compile Problem involving Dependencies Roedy Green <see_website@mindprod.com.invalid> - 2011-10-30 01:28 -0700
  Re: Compile Problem involving Dependencies Martin Gregorie <martin@address-in-sig.invalid> - 2011-10-29 17:24 +0000
  Re: Compile Problem involving Dependencies Roedy Green <see_website@mindprod.com.invalid> - 2011-10-29 23:25 -0700

csiph-web