| | |
How to run external .exe programs from java
![]() |
the code goes like this:
Java Syntax (Toggle Plain Text)
try { Runtime rt = Rintime.getRuntime() ; Process p = rt.exec("Program.exe") ; InputStream in = p.getInputStream() ; OutputStream out = p.getOutputStream (); InputSream err = p,getErrorStram() ; //do whatever you want //some more code p.destroy() ; }catch(Exception exc){/*handle exception*/}
It's not wrong not knowing, but it's wrong not wanting to know.
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 7
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
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
Last edited by alc6379; Oct 23rd, 2004 at 4:30 am. Reason: removed email address
•
•
Join Date: Oct 2004
Posts: 1
Reputation:
Solved Threads: 0
i'm using the code from above to try to run a program and here's my problem... when i call an exe that i wrote in VB, the program runs fine. if i call a c or c++ program the program loads into memory (i see it in the processes tab) but the console doesn't open up with the program in it.
here's the code i have right now for it...
here's the code i have right now for it...
Java Syntax (Toggle Plain Text)
try { Runtime rt = Runtime.getRuntime(); Process p = rt.exec("vbex.exe"); InputStream in = p.getInputStream(); OutputStream out = p.getOutputStream(); InputStream err = p.getErrorStream(); p.destroy() ; }catch(Exception exc){/*handle exception*/}
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: a good IDE for Java Struts?
- Next Thread: calling of any .exe
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application arguments array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class client code color component count database derby design eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui homework html ide if_statement image integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel jtextfield julia keyword linux list macintosh map method methods midlethttpconnection mobile netbeans newbie nullpointerexception object open-source os problem producer program programming project projectideas property read recursion reference replaysolutions ria scanner search server set size sms sort sourcelabs splash sql sqlite stop string swing threads transforms tree ui unicode validation windows






