'Error instantiating class com.sun.comm.Win32Driver' for javax.comm
Here is what I have done:
1. create a new project in Eclipse
2. copied the following from http://www.cafeaulait.org/books/javaio/ioexamples/17/PortLister.java in the new project
import javax.comm.*;
import java.util.*;
public class PortLister {
public static void main(String[] args) {
Enumeration e = CommPortIdentifier.getPortIdentifiers();
while (e.hasMoreElements()) {
System.out.println((CommPortIdentifier) e.nextElement());
}
}
}
it did not compile because of no javax.com package
3. download comm.jar and add to build path so it now compiles.
execute it, but got error:
javax.comm: Can't find javax.comm.properties!
5. add javax.comm.properties to the project
execute it, but got error:
java.io.IOException: Error instantiating class com.sun.comm.Win32Driver
at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
at PortLister.main(PortLister.java:6)
6. add win32com.dll to all directories mentioned by different opinions I googled, including %java_home%/bin, %java_home%/jre/bin, %windor/system32, still get the same error.
What do I miss here? Appreciate any suggestion.
thanks