Problem in RCX-PC-connection PC-program

This is where you talk about the RCX software itself, installation issues, and programming talk.

Moderator: roger

New User
Posts: 1
Joined: Mon Jan 21, 2008 2:19 pm

Problem in RCX-PC-connection PC-program

Postby McFly » Wed Jan 23, 2008 3:54 pm

I'm trying to write a program for my rcx that connects to the pc every hour,
but i'm having some problems with the program that runs on the pc.
I try to compile the in the oustream-example of the rcxcomm.
Thats no problem, the .class-file is made, but if i run
"java Read i get the following error:

C:\lejos\rcxcomm\examples\outstream>java Read
Exception in thread "main" java.lang.NoClassDefFoundError: Read
Caused by: java.lang.ClassNotFoundException: Read
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Where's the problem?
My CLASSPATH looks like this:

Where's the failing?

Thanks a lot



The code of the program:

Code: Select all

import josx.rcxcomm.*;

/**  Runs on the PC and communicates with RCX example.
 * Compile with javac with pcrcxcomm.jar on the CLASSPATH
public class Read {
  public static void main(String [] args) throws IOException {
    RCXPort port = new RCXPort();
    InputStream in = port.getInputStream();
    int b =;
    System.out.println("Read: " + b);

New User
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am

Postby jvance » Thu Jan 24, 2008 2:31 am

It appears to me that your .class file is not their. Or maybe your jre is not installed correctly.
Also, why did this code compile when there is no String argument in the RCXPort constructor? As far as I know, the RCXPort constructor needs a String argument--usb, COM to tell it where to write.
Oh, lastly make sure you have a .; in your CLASSPATH for instance instead of

you would have

Try that out. The .; tells java to search in the current directory as well as the rest of the CLASSPATH

Return to “RCX Software”

Who is online

Users browsing this forum: No registered users and 0 guests