Static import with sefault package

Discussion in 'Java' started by Matteo, Oct 20, 2004.

  1. Matteo

    Matteo Guest

    I'm converting to Java1.5. I've implemented static import with no
    problem, with the exceptions of some statics in a class in the default
    (unnamed) package. When I try to static import this it gives me a
    "cannot find symbol" error on compilation.
    Why?
    How can I do?

    Thank you,
    Matteo
     
    Matteo, Oct 20, 2004
    #1
    1. Advertisements

  2. Matteo wrote:

    > I'm converting to Java1.5. I've implemented static import with no
    > problem, with the exceptions of some statics in a class in the default
    > (unnamed) package. When I try to static import this it gives me a
    > "cannot find symbol" error on compilation.


    I'm not surprised.

    > Why?


    You can't generally import members of a default package since
    1.<mumble>. IIRC, Sun classifies it as a bug [now fixed] that you ever
    were able to do.

    > How can I do?


    Put your classes in a named package. This is good general advice in any
    case.


    John Bollinger
     
    John C. Bollinger, Oct 20, 2004
    #2
    1. Advertisements

  3. Matteo

    Matteo Guest

    "John C. Bollinger" <> wrote in message news:<cl5p05$vd9$>...
    > Matteo wrote:
    >
    > > I'm converting to Java1.5. I've implemented static import with no
    > > problem, with the exceptions of some statics in a class in the default
    > > (unnamed) package. When I try to static import this it gives me a
    > > "cannot find symbol" error on compilation.

    >
    > I'm not surprised.
    >
    > > Why?

    >
    > You can't generally import members of a default package since
    > 1.<mumble>. IIRC, Sun classifies it as a bug [now fixed] that you ever
    > were able to do.
    >
    > > How can I do?

    >
    > Put your classes in a named package. This is good general advice in any
    > case.
    >


    I'll put all in a named package,
    Thank you!
     
    Matteo, Oct 21, 2004
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parvinder
    Replies:
    6
    Views:
    981
    Thomas G. Marshall
    Feb 27, 2005
  2. Paul Opal
    Replies:
    12
    Views:
    1,211
    Paul Opal
    Oct 11, 2004
  3. Dave
    Replies:
    2
    Views:
    601
  4. George P
    Replies:
    3
    Views:
    877
    Alex Martelli
    Sep 11, 2004
  5. David Pratt
    Replies:
    4
    Views:
    503
    David Pratt
    May 13, 2006
  6. Replies:
    1
    Views:
    16,159
    drobert_bfm
    Nov 27, 2007
  7. Gabriel Rossetti
    Replies:
    1
    Views:
    644
    ryles
    Sep 20, 2009
  8. Klein Stéphane
    Replies:
    3
    Views:
    767
    Steve Holden
    Dec 20, 2009
Loading...