views:

244

answers:

3

Hi,

I have a pci-modem in my laptop and I tried to run a program that opens the port and configures it.I get an excepcion while doing it, I think that it can't see the port, even though it is on COM3. Is there any way of doing it in java?

The error I get is noClassDefFoundError. It says the SerialPortEventListener class isn't found. I'm using rxtxcomm. I tried using javax.comm but it doesn't find the port either.

Thanks a lot

+2  A: 

A NoClassDefFoundError indicates that you're missing a JAR file from your classpath, specifically the one that is holding SerialPortEventListener class. Check your classpath.

MrWiggles
+1  A: 

Have you followed the installation instructions for rxtxcomm ? Note you have to handle a library and a jar file. You need to specify a system library path for the native component.

You may find that you get the 'no class def found' if the appropriate .jar is found, but it can't find the corresponding native library to load.

Brian Agnew
A: 

Thanks a lot, rxtxcomm.jar was in the right place but the CLASSPATH wasn't.

Then you probably could accept one of the answers here then?
hlovdal