While writing this tutorial, I installed javaxcomm and received this-new to me-error: D: \> JAVA blackbox Exception in thread "Main" Java. Lang. noclassdeffounderror: javax/comm/portinuseexception I was not using any of the serial ports, So What cocould this mean? I started by using the-verbose switch. However this was not terribly heplful: D: \> JAVA-verbose blackbox [Opened D: \ j2sdk14 \ JRE \ Lib \ RT. jar] [Opened D: \ j2sdk14 \ JRE \ Lib \ sunrsasign. jar] [Opened D: \ j2sdk14 \ JRE \ Lib \ JSSE. jar] [Opened D: \ j2sdk14 \ JRE \ Lib \ JCE. jar] <Snipped out a hundred lines or so> [Loaded java. AWT. event. windowlistener from D: \ j2sdk14 \ JRE \ Lib \ RT. jar] [Loaded blackbox] Exception in thread "Main" Java. Lang. noclassdeffounderror: javax/comm/portinuseexception [Loaded java. Lang. stacktraceelement from D: \ j2sdk14 \ JRE \ Lib \ RT. jar] [Loaded java. util. hashmap $ keyset from D: \ j2sdk14 \ JRE \ Lib \ RT. jar] [Loaded java. util. hashmap $ keyiterator from D: \ j2sdk14 \ JRE \ Lib \ RT. jar] This seems to indicate that the portinuseexception class can't be found. This class is located in the comm. jar file. One solution is to add the javaxcomm JAR file explicitly to my environment classpath: % Java_lib % \ commapi \ comm. Jar <Note: This is incorrect; the reason why is explained below, so keep reading... Then execution generated this error: D: \> JAVA blackbox No serial ports found! From past experience I knew that this results when javaxcomm can't find the javax. Comm. properties file, which causes the serial port enumeration to fail. Hmm, I think I really wanted the comm. jar reference to be the java_home \ Lib \ comm. jar folder, not the java_lib location. OK, change that in my system variables. that does it: D: \> set Classpath = D: \ j2sdk14 \ Lib; D: \ j2sdk14 \ Lib \ comm. jar; Java_home = D: \ j2sdk14 Java_lib = D: \ java_lib Path = D: \ j2sdk14 \ bin; C: \ pvsw \ bin; c: \ windows \ system32; C: \ WINDOWS; c: \ windows \ system32 \ WBEM; D: \> set classpath = % java_lib % \ commapi \ samples \ blackbox. jar; % classpath % D: \> JAVA blackbox COM1: port_owned ... And now I can see the blackbox GUI starting up as expcted. |