Java Communications API NoClassDefFound

I know this is a fairly common problem as I have thoroughly researched it on the internet. When in runtime of any program using the Communications API I get the NoClassDefFound error. I know this is due to either an improper install of the API or an incorrect classpath. However, I can't for the life of me get it working. I'm using Windows XP and I've tried using the command prompt and specifying my classpath using "java -cp [path of comm.jar]; MainClass", however I still get the NoClassDefFound error. I'm beginning to think though that I don't have all of the needed files and/or they are not all in their proper place. I first noticed that several articles I read on the internet mentioned the files win32com.dll and javax.comm.properties. These files did not come in the generic download for the Communications API. I found and downloaded them from other sources; however, I'm afraid they are not current or correct versions of the files. I've also read several different directory paths in which I should be putting these files .I have tried most of them, and still no luck. If someone could provide a link to the correct files I need and the proper directories to put them in, it would be greatly appreciated.

[1233 byte] By [KyleMcGuinna] at [2007-10-3 7:44:20]
# 1
Tell us which class cannot be found. The name of the class should be mentioned after the "NoClassDefFound" exception message.Copy & paste the complete error message here.
jesperdja at 2007-7-15 2:45:34 > top of Java-index,Java Essentials,Java Programming...
# 2
Sorry, don't know why I didn't include the entire thing:java.lang.NoClassDefFoundError: javax/comm/UnsupportedCommOperationException
KyleMcGuinna at 2007-7-15 2:45:34 > top of Java-index,Java Essentials,Java Programming...
# 3

That's definitely a class that should be in comm.jar.

You have not properly included comm.jar in the classpath. What does your classpath look like? How are you running your application?

Are you running your application as an executable JAR (i.e. with "java -jar myapp.jar", or by double clicking on the JAR)? If you do that, the CLASSPATH environment variable and the "-cp" or "-classpath" switches are ignored. You need to set the classpath in the manifest file of the JAR if you run your application that way. [url=http://www.timfanelli.com/item/22]Explanation[/url].

jesperdja at 2007-7-15 2:45:34 > top of Java-index,Java Essentials,Java Programming...
# 4

Well I think you were right, my class path was not set properly. I set the classpath and now I am getting a different error in runtime. The program runs, attempts to open a com port and then I get this:

Opening port...COM1

No such port COM1

Usage: java ServoTest [port]

Example: java ServoTest COM1

Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading driver com.sun.comm.Win32Driver

And COM1 definitely does exist. Any thoughts?

KyleMcGuinna at 2007-7-15 2:45:34 > top of Java-index,Java Essentials,Java Programming...