Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:02:46+00:00 2026-06-08T20:02:46+00:00

i want to code a manager program in java which will execute a c

  • 0

i want to code a manager program in java which will execute a c program and can read it’s input stream and write to output stream.

the client will request c exe then server will handle it’s request like following :

  1. the manager program will execute.
  2. it’ll execute a c program.
  3. can send c program’s output to browser.(input stream).
  4. should be able to accept input from browser and supply to c program.

i have tried executing c code using Runtime and Process. but it gives exception

---------------------------
16 bit MS-DOS Subsystem
---------------------------
Error while setting up environment for the application. Choose 'Close' to terminate the application.
---------------------------
Close   
---------------------------

help?

code :
import java.io.*;

class Dev
{
public static void main(String args[])
{
    try
    {
        Process p = Runtime.getRuntime().exec("dev.exe");
        InputStream is = p.getInputStream();
        // from her i'll do the stuff but it gives error.

    }
    catch(Exception e)
    {
        System.out.print("\n\n\t Error : "+e);
    }
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:02:50+00:00Added an answer on June 8, 2026 at 8:02 pm

    You can execute a program by creating a class that implements Runnable, then passing it a Process, which is described in this answer. The answer there also describes how to get the process’s output in an InputStream. As for passing in some input, this can be done by piping a string in the command line. On the Process-making line from that answer, you can add:

    //...
    String someInput, command; // Set these to the appropriate values.
    Process p = Runtime.getRuntime().exec("echo \"" + someInput + "\"|" + command);
    //...
    

    This will pipe the value of someInput to command. This is based on the command line and is technically platform specific, but should work without changes on Linux, OS X, and Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple java program which is just a single piece of code
I want code in which a div fades out if mouse does not hover
I want to code this part of a VB6 application in c#. How can
I have a program which i want to invoke from windows service. xsftp.StartInfo =
When writing a Java program, do I have influence on how the CPU will
I have a Java program which prints to a HTML file. Another method reads
So this is my question. I have a client and a server java program.
I want code to run whenever I create a new object. For example, see
i want code to check whether the user in logged in or not. I
I want code for keeping 1 second delay in Flex. i.e. i want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.