Archived

This forum has been archived. Please start a new discussion on GitHub.

CLASSPATH for Java chat demos

Hi!

Apologies in advance for what may be an embarrassingly naive newb question:

I've been trying to build the Java chat demo on Windows Server 2003 (just the client, for starters). The ant build is completing without errors, but when I come to run the demo, it's failing with an undefined class. The full error message is:

'Exception in thread "main" java.lang.NoClassDefFoundError : Ice/Dispatcher'

I'm getting similar undefined class errors with all of the Java demos. It seems obvious (even to me) that some major chunk(s) of the Ice Java library are missing from my CLASSPATH. the environment variable was not set when I checked (echo %CLASSPATH%) before attempting to run the client, so I added the classes subdirectory as directed in the demo README files. Since then, I've tried adding every sane variation of possible alternative path that I can think of.

In summary:
  • Is this, as I believe, a missing CLASSPATH entry?
  • If it is, where should I be looking to find the missing classes (in this case, Ice/Dispatcher)


I'd be grateful for any help and quite happy to look stupid if it helps me to get the code working! Cheers, Will.

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Will,

    Welcome to our forums.

    You need to add Ice.jar to your CLASSPATH, if Ice is installed in the default location
    set CLASSPATH=%CLASSPATH%;classes;C:\Program Files\ZeroC\Ice-3.4.2\lib\Ice.jar
    
  • Thanks!

    Many thanks, Jose - I'm glad I don't mind lookin foolish :o

    I'd tried adding the Ice directory to my classpath before, but must have forgotten to open a new session after making the changes. Your reply put me back on track.

    I notice that generally the forum postings are from (relatively) experienced developers. I've been studying the framework as a (41 year old) undergraduate and frequently get bogged down in low level configuration issues like this. If I survive the next three months of my course, I might just contribute some form of "Idiot's guide" to installing and running the sample code for the benefit of my fellow less expert users.

    Best Regards,

    Will.