Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime.exec() how do I prevent console from hiding?

Status
Not open for further replies.

codeManiac

Programmer
May 14, 2003
1
ZA
I want to use java.exe to launch a Java app from my Java program. Problem is the console window does not appear (or contain the output). The program launches OK, but the console is invisible. (on winXP pro and win2000 anyway)
 
How exactly are you launching the second java app? Are you loading java.exe with a jar file? Is it a self-executing jar file?

My suspicion is that it's not starting a second JVM, but running the other app as a new thread in the existing JVM. So your output is going to the loading apps (hidden) console.

If you can post the code that you're using to launch the second app, I'll try it myself.

 
In windows OS's you need to launch a command enterpreter with a console and give it the "java.exe" on the command line parameters to get a console.

Code:
/c start java.exe -jar myapp.jar

look in windows help for the command interpreter switch options

-pete
I just can't seem to get back my IntelliSense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top