• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!