Clay Ellis
Clay Ellis

Reputation: 5330

Run new ant target without killing previous target

I've got an ant target ant server that runs a Java application which logs to the console. I need to run a new ant target ant server-gui which also logs to the console. But when I run ant server the logging prevents me from running any new ant targets.

When I enter ^c (which is the only way I know of to get out of situations like that) it kills the Java application. I need both to run. What keystroke will get me out of that "input" mode and able to run new terminal commands?

UPDATE: I haven't found a direct solution to getting out of that mode I mentioned, but opening a new tab/window in terminal does the trick. I can run as many any commands as I'd like that way. Still looking for a good solution to get out the "input" mode, though!

UPDATE 2: @abcdef pointed out another post that has an even more elegant solution.

Upvotes: 4

Views: 119

Answers (1)

abcdef
abcdef

Reputation: 441

There are a few ways to do this, assuming you are on *nix

1) Run the ant command with a & at the end to tell *nix to run the command in the background

2) Run the command with nohup at the beginning (https://en.wikipedia.org/wiki/Nohup)

3) when the process is running press ctrl-z then enter the command bg. This manually forces the command to run in the background

I hope this helps you out

Upvotes: 1

Related Questions