classpath problem, please help !

Discussion in 'Java' started by IKerr., Oct 22, 2003.

  1. IKerr.

    IKerr. Guest

    Hi,

    I am having great trouble in getting an rmi project to cleanly compile. I
    have been stuck on this for ages and am about to abandon it or chuck the
    machine out the window. Please help, i need to get this working urgently.

    Compile error is:

    --------------------Configuration: PaintShop - j2sdk1.4.1_02
    c:\inetpub\wwwroot--------------------
    C:\Program Files\Xinox Software\JCreator
    Pro\MyProjects\PaintShop\PaintShop\Model.java:54: cannot access
    PaintShop.PaintShopServerInterface
    bad class file: C:\Program Files\Xinox Software\JCreator
    Pro\MyProjects\PaintShop\PaintShop\PaintShopServerInterface.class
    class file contains wrong class: PaintShopServerInterface
    Please remove or make sure it appears in the correct subdirectory of the
    classpath.
    public PaintShopServerInterface server;
    ^
    1 error

    I don't know why on line 3 above it says PaintShop.PaintShopServerInterface,
    because PaintShopServerInterface is not in package PaintShop.

    Okay, so it tells me what is wrong - but I don't how to fix it. The model
    etc are in a package called "PaintShop". The reference to the server
    interface object in the model is
    public PaintShopServerInterface server;

    the bind is

    server = (PaintShopServerInterface)
    Naming.lookup(RMIHOST+RMISERVERPORT+RMISERVER);

    Class PaintShopServer is not in a package and implements
    PaintShopServerInterface.
    PaintShopServerInterface is not in a package.

    Hope that someone out there can help 'cause I sure need it :(

    Iain
     
    IKerr., Oct 22, 2003
    #1
    1. Advertising

  2. IKerr.

    Phil Hanna Guest


    >Compile error is:
    >
    >--------------------Configuration: PaintShop - j2sdk1.4.1_02
    >c:\inetpub\wwwroot--------------------
    >C:\Program Files\Xinox Software\JCreator
    >Pro\MyProjects\PaintShop\PaintShop\Model.java:54: cannot access
    >PaintShop.PaintShopServerInterface
    >bad class file: C:\Program Files\Xinox Software\JCreator
    >Pro\MyProjects\PaintShop\PaintShop\PaintShopServerInterface.class
    >class file contains wrong class: PaintShopServerInterface
    >Please remove or make sure it appears in the correct subdirectory of the
    >classpath.
    > public PaintShopServerInterface server;
    > ^
    >1 error


    From what directory are you compiling this, and what exactly is your
    javac command? If you're in MyProjects\PaintShop\PaintShop, you
    should be OK. If it's MyProjects\PaintShop, that's the problem. The
    package structure of any class must match the directory structure of
    something in the CLASSPATH. If PaintShopServerInterface is in the
    default package (i.e., no package), then it has to be directly in a
    directory in the path, not a subdirectory thereof.

    By the way "Classpath problem" is redundant. *All* problems are
    classpath-related (OK, I'm stretching this a bit... :)
    --
    Phil Hanna
    Author of JSP 2.0: The Complete Reference
    http://www.philhanna.com
     
    Phil Hanna, Oct 23, 2003
    #2
    1. Advertising

  3. IKerr.

    IKerr. Guest

    Hi Phil,

    thanks for your suggestion. I have run out of time on this for now, but
    hope to get back to this next week, so will try it out then.

    Iain

    "Phil Hanna" <> wrote in message
    news:...
    >
    > >Compile error is:
    > >
    > >--------------------Configuration: PaintShop - j2sdk1.4.1_02
    > >c:\inetpub\wwwroot--------------------
    > >C:\Program Files\Xinox Software\JCreator
    > >Pro\MyProjects\PaintShop\PaintShop\Model.java:54: cannot access
    > >PaintShop.PaintShopServerInterface
    > >bad class file: C:\Program Files\Xinox Software\JCreator
    > >Pro\MyProjects\PaintShop\PaintShop\PaintShopServerInterface.class
    > >class file contains wrong class: PaintShopServerInterface
    > >Please remove or make sure it appears in the correct subdirectory of the
    > >classpath.
    > > public PaintShopServerInterface server;
    > > ^
    > >1 error

    >
    > From what directory are you compiling this, and what exactly is your
    > javac command? If you're in MyProjects\PaintShop\PaintShop, you
    > should be OK. If it's MyProjects\PaintShop, that's the problem. The
    > package structure of any class must match the directory structure of
    > something in the CLASSPATH. If PaintShopServerInterface is in the
    > default package (i.e., no package), then it has to be directly in a
    > directory in the path, not a subdirectory thereof.
    >
    > By the way "Classpath problem" is redundant. *All* problems are
    > classpath-related (OK, I'm stretching this a bit... :)
    > --
    > Phil Hanna
    > Author of JSP 2.0: The Complete Reference
    > http://www.philhanna.com
     
    IKerr., Oct 23, 2003
    #3
    1. Advertising

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. Flip
    Replies:
    3
    Views:
    7,412
    Tony Morris
    Feb 9, 2004
  2. Gabe
    Replies:
    3
    Views:
    1,120
  3. KK
    Replies:
    2
    Views:
    711
    Big Brian
    Oct 14, 2003
  4. Replies:
    2
    Views:
    810
  5. Replies:
    2
    Views:
    1,160
    Mike Schilling
    Mar 2, 2008
Loading...

Share This Page