简体   繁体   中英

Com port issue in java

I was trying to write COM port using Java. But when i debug, it gives a window with checkbox for selecting ports showing,

gnu.io.rxtx.properties has not been detected. There is no consistant means of detecting ports on this operating System. It is necessary to indicate which ports are valid on this system before proper port enumeration can happen. Please check the ports that are valid on this system and select Save.

How can solve this problem.

You will need to check if your VM have the required files to initialize the COM port communication? If none, you probably have to find those files first.

You might want to check out the webby at:

http://www.oracle.com/technetwork/java/index-jsp-141752.html

also if you need an example, checkout:

http://www.java2s.com/Code/Java/Development-Class/OpenaserialportusingJavaCommunications.htm

Hope it helped.

Cheers, Vern

The window you are describing is part of the RXTX library. The RXTXcomm.jar has a Configure class which contains a main method. You are seeing the popup because you are running the main method from Configure and not debugging your application. In your debugger make sure you are actually debugging your code and not the RXTX library.

gnu.io also has a main class. By default Eclipse picks the main method of gnu.io.

Go to Project --> Run As --> Run Configurations --> Java Applications --> (Your Run Configuration) --> Main -->

In Main class textBox use the search button to select your class as the main class. Your problem should be fixed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM