• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

telnet in Win2000/XP using java runtime.exec ??

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i need to start the telnet session from java . the following code works fine in 98/ nt 4.0 but it does not work in win2k/XP . if returns an exitvalue of -1 thats all. can any one tell me why . is it because the telnet program in these environments seem to work differently because they do not open the window as in 98 or NT 4.0 . any work arounds
Process p = Runtime.getRuntime().exec("telnet");
BufferedReader br = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedWriter bw = new BufferedWriter(new
OutputStreamWriter(p.getOutputStream()));
bw.write("1");
bw.flush();
String line;
while ((line = br.readLine()) != null)
{
System.out.println(line);
}
br.close();
bw.close();
System.out.println(p.exitValue());
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question was first asked here. :roll: Please don't crosspost.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed. This topic is closed.
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic