• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

is Runtime the right class for me?  RSS feed

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I am writing a program that among other things, it copies and recieves files from remote computer, since I've failed to use the Jcraft, I am now resolved to use the Runtime class that (as I understand) I can use to write command lines to the shell , and with this , I can transfer the files I want(as I do through the shell - manually)
does anyone have a simple code sample for writing to the shell ?
or refference? or anything ?
thanks, dave
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the various versions of Runtime.exec(). Basically, you give it either a single String forming your entire command or a String[] of the command with parameters, depending on your needs. You can also specify extra environment variables plus a current working directory.Check out the Process class to see how to capture its output and feed it input.
 
Dave Jones
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, I need some more info,but it seems to be what I'm looking for
Dave
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!