简体   繁体   中英

Writing in Command Prompt through Java?

So my question may be a little wide so I'll narrow it down here, I have been able to develop code that easily opens command prompt. My question is this, through say the IDE Eclipse, if I ran my program their that printed out HELLO!, how could I make it appear on the command prompt WITHOUT!!! actually accessing command prompt and running my code their?

More calarification? I need a line of code or method that when its executed it opens the command prompt and writes hello. Many would say why not have it run to say hello there but thats defeating the purpose of my task. To clarify further, if I was to run this in windows command prompt instead of eclipse, it would still open a new command prompt window and write hello in their acting as the System.out, THANKS!

Disclaimer: I don't recommend this, just answering the question

You'd have to run Java in each console with an application that was listening for data from the controlling application (not going to get into how that communication could work, but sockets would be an obvious choice).

The listening application could then write to the console when it receives data from the controlling application - more trouble than it's worth imho

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM