classpath problem, please help !

I

IKerr.

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
 
P

Phil Hanna

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... :)
 
I

IKerr.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top