Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java executing other programs...

Options
  • 30-01-2003 12:51pm
    #1
    Posts: 0


    Hey all,

    I know this is a question that has been asked before but I really need some help with this one.

    In my program, the user selects a file and then I have to see if that file compiles. To do this, I need to execute an outside program and pass the name of the file to it.

    I've gotten plenty of CreateProcesses exception (error = 2) and when that was fixed, I get an error message from the system (windows nt 4.0) , which is "16 bit MS-DOS Subsystem, C:\WINNT\system32\ntvdm.exe Error while setting up environment for the application".

    Sometimes this comes up, sometimes it doesn't.
    I'm thinking that maybe the system is allowed perform these tasks or something like that, as I can't see a way how the programmer can work around this.

    code:
    Process p = Runtime.getRuntime().exec(cmds);
    BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));


    cmds is the string array containing the name of the program and the argument to be passed to it.

    Any help on this would be great, folks, thanks :)


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Is this specific to Windows? If so you could use J/Direct in the Microsoft VM. I´m too lazy and too far away from home to remember how to do this stuff but look at this on msdn.microsoft.com and it might help.


  • Registered Users Posts: 919 ✭✭✭timeout


    well when I was trying to do this I was sent here .

    It helped me out, but yours sounds like its got something to do with NT.

    Sorry I can't be of more Help
    Timeout


Advertisement