2

I want to get the list of all available serial ports on a linux machine using java 6

Vamsi
  • 4,237
  • 7
  • 49
  • 74
  • possible duplicate of [How to get list of available serial ports in my pc?](http://stackoverflow.com/questions/4493279/how-to-get-list-of-available-serial-ports-in-my-pc) – jmj Nov 08 '11 at 10:34
  • I have checked that code it is not working on linux – Vamsi Nov 08 '11 at 10:36
  • the statement while (pList.hasMoreElements()) is always false in the code so it is not executing the rest of code – Vamsi Nov 08 '11 at 10:40

2 Answers2

1

i have used rxtx on windows which worked well. there is a linux version: http://rxtx.qbang.org/wiki/index.php/Installation_on_Linux

Ray Tayek
  • 9,841
  • 8
  • 50
  • 90
0

The command under Linux is dmesg | grep tty

I think you need to implement the abstract class Process and call the Runtime.exec() method, that returns a Process object.

Please read here and here.

Hope this helps.

Simone
  • 20,302
  • 14
  • 79
  • 103