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 Read.java 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 java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown 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:
CLASSPATH=C:\lejos\lib\classes.jar;C:\lejos\lib\pcrcxcomm.jar;C:\Programme\Java\
jre1.6.0_04\lib\ext\QTJava.zip
Where's the failing?
Thanks a lot
Felix
P.S:
The code of the program:
- Code: Select all
import josx.rcxcomm.*;
import java.io.*;
/** Runs on the PC and communicates with Write.java 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 = in.read();
System.out.println("Read: " + b);
}
}
