tags:

views:

67

answers:

3

Is there an open source telnet API/library out there for Java (something like Python telnetlib)? I need to connect to a server using telnet and execute some commands from within a Java program.

A: 

Sure is.

http://sourceforge.net/projects/jtelnet/ (EDIT: Noted as crap.)

Here is an Apache project which is presumably much more handy:

http://commons.apache.org/net/

Helgi Hrafn Gunnarsson
Lets see, last website update in 2003, last file update in 2003, and 2 negative votes with a comment saying its very bad. I don't think so
TheLQ
Yeah, I noticed that like 3 seconds after I posted it. ;)
Helgi Hrafn Gunnarsson
+4  A: 

My preference is to use the Apache Commons-Net library. http://commons.apache.org/net/ It supports many client protocols, including Telnet.

I've used this in the past and it works quite well.

Paul Kuykendall
A: 

Maybe is worth considering using SSH protocol, instead of Telnet. Telnet is much less secure, for instance all the data is transmitted as plain text (including your passwords).

kofucii
it's a windows machine that already has a telnet server, it's also in the internal network, so no outside access (no security concerns).
shipmaster