Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > classpath problem, please help !

Reply
Thread Tools

classpath problem, please help !

 
 
IKerr.
Guest
Posts: n/a
 
      10-22-2003
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\PaintShopServer Interface.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


 
Reply With Quote
 
 
 
 
Phil Hanna
Guest
Posts: n/a
 
      10-23-2003

>Compile error is:
>
>--------------------Configuration: PaintShop - j2sdk1.4.1_02
>c:\inetpub\wwwroot--------------------
>C:\Program Files\Xinox Software\JCreator
>Pro\MyProjects\PaintShop\PaintShop\Model.java:5 4: cannot access
>PaintShop.PaintShopServerInterface
>bad class file: C:\Program Files\Xinox Software\JCreator
>Pro\MyProjects\PaintShop\PaintShop\PaintShopServe rInterface.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
 
Reply With Quote
 
 
 
 
IKerr.
Guest
Posts: n/a
 
      10-23-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> >Compile error is:
> >
> >--------------------Configuration: PaintShop - j2sdk1.4.1_02
> >c:\inetpub\wwwroot--------------------
> >C:\Program Files\Xinox Software\JCreator
> >Pro\MyProjects\PaintShop\PaintShop\Model.java:5 4: cannot access
> >PaintShop.PaintShopServerInterface
> >bad class file: C:\Program Files\Xinox Software\JCreator
> >Pro\MyProjects\PaintShop\PaintShop\PaintShopServe rInterface.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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.classpath file instead of the CLASSPATH Environment variable. dontspammenow@yahoo.com Java 2 03-02-2008 08:19 AM
Classpath Problems for JDBC, Please help a student Tom Java 6 07-27-2007 08:33 AM
problem compiling project, classpath in xml ".classpath" "<classpathentry...>" jameshanley39@yahoo.co.uk Java 2 03-02-2007 12:37 PM
while using javac -classpath some.jar some.java (Where does classpath get stored?) Gabe Java 3 08-27-2004 07:02 PM
CLASSPATH, -cp and -classpath misunderstanding? Flip Java 3 02-09-2004 10:09 PM



Advertisments