Pizza Posted March 5, 2008 Share Posted March 5, 2008 my school is going to contest i need some help i want to exec commends using java to cmd but the output of the cmd wont show on java i want it output that cmd give show up in java's output contest http://contest.cs.iupui.edu/ thanks i think i will make program that has gui and exec commend to a commend line program depends on what my partner wants to do Quote Link to comment Share on other sites More sharing options...
SomeoneE1se Posted March 5, 2008 Share Posted March 5, 2008 I don't think you can do that... I thought the point of java was that it couldn't interact with the host OS unless I completely misunderstood Quote Link to comment Share on other sites More sharing options...
twocs Posted March 5, 2008 Share Posted March 5, 2008 You would need to use the java.lang.* method Runtime.exec(), which allows you to run programs outside. "Developers often call this method to launch a browser for displaying a help page in HTML." http://www.javaworld.com/javaworld/jw-12-2...1229-traps.html To execute and capture the output of an external program: http://www.rgagnon.com/javadetails/java-0014.html Quote Link to comment Share on other sites More sharing options...
K1u Posted March 8, 2008 Share Posted March 8, 2008 I don't think you can do that... I thought the point of java was that it couldn't interact with the host OS unless I completely misunderstood Uhm actually no. Look at the post above mines. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.