Java program, where I use javacomm20-win32.zip. This article describes how to configure the three main files under the compressed package in eclipse, Comm. jar, javax. Comm. properties, and win32comm. dll. Other development configurations, such as environment variable settings, are provided here.
This is meProgramPart of the log:
After a day of Java serial programming in eclipse. The relevant program has been found, compilation can also pass, that is, the serial port cannot be found during running, the specific reaction to the program is portlist. hasmoreelements () returns false, indicating that the serial port and parallel port cannot be found. I checked a lotArticle, Are said to be the configuration of three files in the javacomm20-win32 package. I have found a lot on the Internet. Some people say that the sub-directories under the jdk1.6.x directory are configured, some are the folders under jre1.6.x, and some are the directories under the JRE folder. After repeated configuration, I finally saw an article about the eclipse development environment and runtime environment configuration. After reading the article, I understand it myself. That is to say, if multiple JDK is installed in the system, then, when installing eclipse, a directory will be selected (I did not check the specific selection, which is temporarily irrelevant to me, this can be found in help> about eclipse> Installation Details> Configuration Under eclipse. In my configuration, the configuration paths of the three files mentioned above are:
Java. Ext. dirs = C:/program files/Java/jre6/lib/EXT; C:/Windows/Sun/Java/lib/EXT
Java. library. path = C:/program files/eclipse ;.; c:/Windows/Sun/Java/bin; C:/Windows/system32; C:/windows; C:/program files/Java/jre6/bin/client; C: /program files/Java/jre6/bin; C:/Windows/system32; C:/windows; C:/Windows/system32/WBEM; C: /program files/common files/thunder Network/Kankan/codecs; C:/program files/common files/ttkn/bin; C:/program files/IDM computer solutions/UltraEdit-32; c:/progra ~ 1/att/graphviz/bin; C:/program files/Java/jdk1.6.0 _ 06/bin; C:/program files/tortoisesvn/bin; C: /program files/Microsoft Visual Studio/common/tools/winnt; C:/program files/Microsoft Visual Studio/common/msdev98/bin; C: /program files/Microsoft Visual Studio/common/tools; C:/program files/Microsoft Visual Studio/vc98/bin; C:/program files/stormii/codec; C: /program files/stormii
Sun. boot. Library. Path = C:/program files/Java/jre6/bin
And the Java home path is:
Java. Home = C:/program files/Java/jre6
Sun. boot. class. path = C:/program files/Java/jre6/lib/resources. jar; C:/program files/Java/jre6/lib/RT. jar; C:/program files/Java/jre6/lib/sunrsasign. jar; C:/program files/Java/jre6/lib/JSSE. jar; C:/program files/Java/jre6/lib/JCE. jar; C:/program files/Java/jre6/lib/charsets. jar; C:/program files/Java/jre6/classes
Therefore, I believe that my eclipse uses the C:/program files/Java/jre6 configuration.
After experimental analysis, the storage paths of the three files are determined as follows:
Javax. comm. the properties file must be stored in C:/program files/Java/jre6/lib (the Java home in eclipse is C:/program files/Java/jre6. If Java home has changed, the path here needs to be changed)
It doesn't matter where comm. jar is stored. You just need to right-click the project to use it-> properties-> JAVA build path-> libraries-> Add external jars to add the same path.
Place win32com. dll in C:/program files/Java/jre6/bin. Or put it in the directory specified by Java. Library. Path mentioned above.
at this point, the configuration of the three files is complete. After a whole day, I finally figured out why so many configurations on the Internet were not configured in eclipse. I didn't understand the runtime environment selected by eclipse. Therefore, if you encounter similar problems in the future, first check the installation information of Eclipse, determine its runtime environment, and then configure Other.