I have been installing a Java serial port package for half a day and cannot find the serial port. Now I am done. Make a record ~
Because it is developed under Windows, go to download the http://mdubuc.freeshell.org/Jolt/javacomm20-win32.zip (complete version 2.0, and examples ). Installation instructions: (the so-called installation here is to put three important files under the specified directory). After extracting the downloaded files, there are three required files in the \ javacomm20-win32 \ commapi directory comm. jar, javax. comm. properties and win32comm. DLL. Upload the file comm. copy jar to % java_home % \ JRE \ Lib \ ext; file javax. comm. copy properties to % java_home % \ JRE \ Lib; file win32comm. copy the DLL to % java_home % \ bin.
Note that-% java_home % is the JDK path, not the JRE.
The above attention is very important. We have been copying these three files to the Java \ JRE Directory, which is actually the JRE under JDK. For example, according to the path of my machine, the three files are:
Comm. Jar copy to c: \ Program Files \ Java \ jdk1.6.0 _ 23 \ JRE \ Lib \ ext; Copy javax. Comm. properties
C: \ Program Files \ Java \ jdk1.6.0 _ 23 \ JRE \ Lib; copy win32comm. DLL
C: \ Program Files \ Java \ jdk1.6.0 _ 23 \ Bin. Bytes ----------------------------------------------------------------------------------------------------
The preceding settings are used in the development environment. If you have already built the project jar and want to double-click it to run it, you need to install it in the JRE environment. In fact, you need to copy the three files
C: \ Program Files \ Java \ jre6 directory can be ~