• Post Reply Bookmark Topic Watch Topic
  • New Topic

Platform independence dialing a modem  RSS feed

 
Julian Vicente
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody:
I need to dial a modem from Java. Searching in the forum, I find two ways of doing that:
- Using javax.comm (Java Communication API)
- Running commands with Runtime.exec()
I�m going to use Linux, but I want my program to be portable to other platforms, so I prefer not to use commands. Looking at javax.comm documentation I find there isn�t a Sun implementation for linux, and also that, in the win32 implementation, you need installing some .dll.
That means that a program using javax.comm wouldn�t be portable? I sadly supose the answer is yes, so I wanna know is there is another, platform-independent way of dealing whit the modem.
This is my first post in this forum, so if I expect doing it the rigth way...
Thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use the javax.comm API, then your program will be portable to any machine which has that standard extension installed. This is no different than, say, a Java3D program, which will only work in JVMs where the platform-specific Java3D libraries are installed.
It's not possible to talk to serial ports portably from Java without the javax.comm APIs, so that's your best bet.
 
Julian Vicente
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer... but I have another question.
I can run my program in any machine with the extension instaled in it, but it�s posible to install the javax.comm in any machine? I ask it because Sun doesn�t offer a distribution of the communications package for Linux... That means that it�s imposible to install the extension in a Linux machine? Or maybe I must try to find an implementation anywhere else?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, no, not really. Sun actually hasn't done any new work on javax.comm in a long time, and I'm not sure why.
The closest thing to a portable serial comm API is RXTX -- see http://www.rxtx.org/ .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!