-2

I want to create a Java program through which I can compile and run another program.
I usually know how to compile and run via cmd. Is there any idea to use cmd command in Java program?

2
  • Do you mean compile and run a program on cmd, which in itself will compile and run a second program? And if so, why? Commented Aug 21, 2013 at 18:28
  • andrew i'm creating a java project to compile compile and run other java programs. Commented Aug 21, 2013 at 18:31

1 Answer 1

0

Yes, there is. You use the ProcessBuilder class, or Runtime.exec. For more details, see the java API.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.