| Author |
Running Programs from JAVA Programs
|
Parth Sagdeo
Ranch Hand
Joined: Mar 18, 2004
Posts: 40
|
|
Hi all, How would one run another program from a JAVA program. For example, how would one code a program open a web browser or compile another JAVA file? Sincerely, Parth
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
The short answer to this question is that you use the command: Runtime.getRuntime().exec("javac MyClass.java"); However there are some pitfalls and things to be aware of in running this. Here's a link to an article that explains some of them: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Good Luck. Merrill
|
Merrill
Consultant, Sima Solutions
|
 |
Surasak Leenapongpanit
Ranch Hand
Joined: May 10, 2002
Posts: 341
|
|
|
If you want to compile the other classes at runtime, see Compiler class in Java API.
|
 |
 |
|
|
subject: Running Programs from JAVA Programs
|
|
|