How to run external .exe programs from java
Hi everyone,
Could some one please tell me or show me the entire codings of how to run external .exe programs in java. I want to do this because i have a lot c/vb programs that i want to run in my java program.
Thank You
Yours Sincerely
Richard West
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
try out this code ... it will not be platform independent ....
Process p = Runtime.getRuntime().exec("c:\myprogram.exe");
I dont have the time to test it .... if you succeed please tell me too.
:eek:
nanosani
Unauthenticated Liar
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
Hi everyone,
The above codes only seem to run external .exe programs but what if i want to run external jar programs. Could someone show me or e-mail me the codings of how to do this the right way.
Thank You
Yours Sincerely
Richard West
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
nanosani
Unauthenticated Liar
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
hi everyone,
Do this instead
void run ()
{
try
{
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("vbex.exe");
}
catch(Exception e)
{
}
}
I hope this helps you
Richard West
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
JamesCherrill
Posting Genius
6,339 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,070