我正在使用Windows 8.1,64bit系统,并使用javax.comm api发送短信,但由于javax.comm.properties
中的某些不匹配而导致我在运行程序时遇到错误,它看起来像是傻瓜:
# javax.comm.properties (Linux)
#
# This properties file is necessary in order for javax.comm to run,
# and its contents are critical, and not to be tampered with without
# a very clear understanding of the impact. It is shipped with a
# default set of values that work on the target platform.
#
# 1. The directory javax.comm is launched from
# 2. Each directory in the classpath (including the one in which comm.jar is in)
# 3. <jvm dir>/lib
# 4. <jvm dir>/jre/lib
#
# The following properties must be defined:
#
# driver
# serpath0 ... serpath<n>
# parpath0 ... parpath<n>
#
#
# Driver:
#
# The driver property specifies the fully qualified class name of the
# platform specific implementation of the javax.comm.CommDriver class.
#
# Format:
#
# driver=<fully qualified classname>
#
# Example:
#
# driver=com.sun.comm.LinuxDriver
#
# Port paths:
#
# Port paths must be specified to indicate to the implementation
# which are the core set of ports to make available. These can
# be either paths to directories containing ports or paths to
# specific serial or parallel ports.
# Implementation specific driver
#driver=com.sun.comm.rxtxSerial
Driver=com.sun.comm.Win32Driver
# Paths to server-side serial port devices
serpath0 = /dev/ttyS0
serpath1 = /dev/ttyS1
# Paths to server-side parallel port devices
parpath0 = /dev/parport0
parpath1 = /dev/parport1
我收到如下错误:
java.io.IOException: Error instantiating class com.sun.comm.Win32Driver
com.sun.comm.Win32Driver
at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:238)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
at SimpleWrite.main(SimpleWrite.java:69)
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayIn
fo.isSessionActive()Z
at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
at SimpleWrite.main(SimpleWrite.java:69)
我需要做出哪些改变才能开始工作?