aspose file tools*
The moose likes I/O and Streams and the fly likes CommPortIdentifier.getPortIdentifiers is empty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "CommPortIdentifier.getPortIdentifiers is empty" Watch "CommPortIdentifier.getPortIdentifiers is empty" New topic
Author

CommPortIdentifier.getPortIdentifiers is empty

skumar kk
Greenhorn

Joined: Apr 06, 2011
Posts: 6
Hi guys, i got a problem about using javax.comm.

I've downloaded the Windows version of Java Commnunication API from java.sun.com.
I extracted the zip file, placed the comm.jar at c:\j2sdk1.4.0\jre\lib\ext folder.After that, i wrote a simple program to test whether i can get any serial/parallel port object from CommPortIdentifier.getPortIdentifiers();. It returns an empty enumeration, meaning that none of my ports are detected.
However I have checked that com1 port is exist using hyperterminal.
Please let me know if you have any information regarding this issue.

I have RFID card reader and I am trying to read data from rfid card.
Ramon Anger
Ranch Hand

Joined: Apr 19, 2011
Posts: 56

Hi,

which windows version do you use?
What about the win32com.dll and javax.comm.properties?

win32com.dll -> c:\j2sdk1.4.0\jre\bin
javax.comm.properties -> c:\j2sdk1.4.0\jre\lib

Regards,
Ramon


Blackbelt on BlackBeltFactory.com.
skumar kk
Greenhorn

Joined: Apr 06, 2011
Posts: 6
Thanks for reply.

I am using windows XP OS.
I have not done anything about the win32com.dll and javax.comm.properties file. Please tell me from where I should get these file or what will content of these files.
I am using Java1.6.
Ramon Anger
Ranch Hand

Joined: Apr 19, 2011
Posts: 56

Hi,

it seems, using win32com.dll and javax.comm.properties is outdated. Oracle actually describes the howto use javax.comm for windows at http://www.oracle.com/technetwork/java/index-jsp-141752.html as follows:

Sun no longer offer's the Windows platform binaries of javax.comm, however javax.comm 2.0.3 can be used for the Windows platform, by using it in conjunction with the Win32 implementation layer provided by the RxTx project. To use that, download javax.comm for the 'generic' platform (which provides the front-end javax.comm API only, without platform specific back-end implementations bundled). Then acquire the Windows binary implementation rxtx-2.0.7pre1 from http://www.rxtx.org.

The website http://www.rxtx.org no longer exists but you can download that bundle from http://rxtx.qbang.org/wiki/index.php/Download

Hope that helps.
Cheers,
Ramon
skumar kk
Greenhorn

Joined: Apr 06, 2011
Posts: 6
Hello,

My problem is resolved and now I am able to read rfid card data from java program. I got detail description on http://www.intellog.com/blog/?p=255#comment-47305 to resolve this issue.

Thanks ,
Skumar.
Ria De
Greenhorn

Joined: Apr 26, 2013
Posts: 13
skumar kk wrote:Hello,

My problem is resolved and now I am able to read rfid card data from java program. I got detail description on http://www.intellog.com/blog/?p=255#comment-47305 to resolve this issue.

Thanks ,
Skumar.


I have the same problem ,java can't find ports.
I can't open the link above.
can you explain here how you solved it?

thanks
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2316
    
  49
Unfortunately you're unlikely to get an answer from skumar kk as he/she last posted in 2011.

It may be worth checking out our IO FAQ page as there are a number of articles on using comm ports.
D Kess
Greenhorn

Joined: May 05, 2014
Posts: 1
Ria De wrote:

I have the same problem ,java can't find ports.
I can't open the link above.
can you explain here how you solved it?

thanks


Ria, did you figure it out? Having a similar issue, but no luck.
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2316
    
  49
Did you check out the IO FAQ link I gave in my previous post?
If so and you still haven't found a solution can you describe your problem in detail (rather than just saying you have a similar issue).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CommPortIdentifier.getPortIdentifiers is empty