Running external programs


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Running external programs

  1. #1
    Join Date
    Apr 2004
    Location
    South Africa
    Posts
    6

    Question Running external programs

    i know that to run an external program you have to use the Runtime.exec() method, but i'm having some difficulty with it. i've created a runtime environment variable using the getRuntime() method and used this to call the exec() method, specifically the exec(String command, String[] environment, File dir) method but when it executes it gives an IOException that's something about the String command and error=0 (i can't recall the exact message)

    So my question basically is, if i'm doing it wrong, how do u implement the Runtime class with the exec method and what exactly is the String command ie the DosPrompt cmd to run the program or what?

  2. #2
    Join Date
    May 2004
    Location
    Durham, UK
    Posts
    174

    exec information

    Hi Toffie,

    This is covered in the JDC Tech Tips February 15, 2000

    which you can view at

    http://java.sun.com/developer/TechTi...0209.html#tip2


    Hope this helps
    Hope this helps
    Graham

    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, and if they get mad, you are a mile away and you have their shoes ;-)

    http://www.grahamrobinsonsoftware.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center