• 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Newbie, Need Java clarification

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am a Sys Admin and have been using VBScript and Perl for some time and now looking into Java. Can you initiate a system call to the OS from within java. For example, sometimes in perl I use the system command which allows me to use some Windows native commands which are better in certain instances, like net use etc. I want to be able to run a java program from my machine and access files on remote machines to parse, getdata, etc. Those remote machines are 98% Windows and have the JRE 1.3 installed. Any suggestions would be great.
Thanks in advance,
Dave
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Runtime to do that. However it makes your code platform dependent.


To make it a little more platform independent, best way is to look for the executable at the path(s) you expect - if not found ask the user to locate the executable.
Hope this helps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!