Forums Register Login

Executing MSDOS command with flashing MSDOS-Window

+Pie Number of slices to send: Send
Dear All,
I want to execute the java program which calls the subclasses. The output of the subclasses should be displayed on different MSDOS-Window Consoles. For this i am using the following piece of code....
Process proc=Runtime.getRuntime().exec("cmd /c start /k java test.SubClass1");
But I am not able to see different Consoles, though it had created the new process and excuted the program.
My O.S Environment is Win2000 and the java version is 1.4
Advance TX for the suggestion given...
Regards,
Saradhi.
+Pie Number of slices to send: Send
Going through runtime.exec that way will create a whole new instance of Java, a new JVM, all that good stuff. Is that really necessary? If you can run in the same JVM just call your class with SubClass1.main(someStringArray).
I don't know of any way to open a console window with runtime.exec. It always runs things invisibly. You could connect streams to the stdout, errout and stdin of the running process and build your own window that looks a lot like a command window, but that's pretty complicated!
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 923 times.
Similar Threads
Java Compilation at MSDOS prompt
Releasing the JRE
how a java program compiles and runs?
Multiple Consoles in Eclipse
Is this possible? 2 consoles?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:26:30.