Results 1 to 2 of 2

Thread: help required

  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: help required

    I have to call a C program from JAVA . Please guide me along the steps neccessary

  2. #2
    Join Date
    Mar 2004
    Posts
    16
    add this code:

    Runtime.getRuntime().exec("cmd");
    where cmd is the process you want to call (you have to think you're running a new process just as if you were typing from Windows' start->run menu or from a shell)

    example:
    Runtime.getRuntime().exec("calc");
    will run windows' calculator.

    Keep in mind that the method exec of Runtime class is overloaded, this means that exist more than one type of exec, depending the kind of call you want to do (i.e. if you want to call a process with some command-line parameters you have to use
    Runtime.exec(String[] cmdarray);
    ), so look at the Java API!!

    Bye,
    D.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •