Find the answer to your Linux question:
Results 1 to 4 of 4
Hi everyone please forgive me if this question is not appropriate here.... I want to call c exe from java source code and i want to interact with the c ...
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    10

    Post Calling c exe from java source

    Hi everyone please forgive me if this question is not appropriate here....

    I want to call c exe from java source code and i want to interact with the c program during it's execution, i am able to send the parameters to c program but i am not able to interact with it....so, please help me in this regard... thanx in advance every one

  2. #2
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    First: do not excuse for something you perfectly know it is wrong. Instead do it right from the start and put it into the right place.

    Second: how did you intend to interact with the c program?

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Posts
    10
    I used the exec method of Runtime, but with this i am able to pass parameters to c program but i am not able to interact with it.


    Example:

    Runtime rt=new Runtime();
    Process p=rt.getRuntime().exec("./hello praff");

    In this i am able to send parameters to c program.


    but if i want to read something in c using scanf during the execution it's not working.

  4. #4
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    Of course it doesn't. Where should it get the input from? Your program does not provide any kind of input stream to the "hello" process.

Posting Permissions

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