嗨,我收到此错误:
加载 win32com 时出错:java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jre1.8.0_60\bin\win32com.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
运行此程序时:
public static void main(String args[]) {
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
System.out.println(ports.hasMoreElements());
while (ports.hasMoreElements()) {
CommPortIdentifier port = (CommPortIdentifier) ports.nextElement();
String type;
switch (port.getPortType()) {
case CommPortIdentifier.PORT_PARALLEL:
type = "Parallel";
break;
case CommPortIdentifier.PORT_SERIAL:
type = "Serial";
break;
default: /// Shouldn't happen
type = "Unknown";
break;
}
System.out.println(port.getName() + ": " + type);
}
// System.out.println(port.getName());
}
我正在使用 java 1.8
提前致谢