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
10 Months Ago
Last Updated
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
Skill Endorsements: 0
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
Technize.net addict
1,832 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
Skill Endorsements: 0
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
Skill Endorsements: 0
nanosani
Technize.net addict
1,832 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
Skill Endorsements: 0
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
Skill Endorsements: 0
JamesCherrill
... trying to help
8,660 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,475
Skill Endorsements: 33
first of all, you could have figured out that this thread is 8 years old, and has been revived way to many times already. secondly, you could 've read the answers already given.
also, you might want to provide some more information.
are we talking a complete separate system? do you have a "client" app on the remote machine, can you access the remote machine, ... ?
stultuske
Industrious Poster
4,489 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 627
Skill Endorsements: 25
DaniWeb Member Rules include:
"Do not hijack old threads by posting a new question as a reply to an old one"
http://www.daniweb.com/community/rules
Please start your own new thread for your question
JamesCherrill
... trying to help
8,660 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,475
Skill Endorsements: 33