run Java commands through a Shell script

1.3k views Asked by At

I'm trying to code a shell script to start/stop torrents using vuze's console UI through SSH: https://wiki.vuze.com/w/Console_UI

I've downloaded vuze and everything works fine until I type this command:

java -jar Azureus2.jar --ui=console

After that, no command in my script works unless I quit that console.

Any solutions please? And if it's not feasible using shell scripts, any suggestions please?

Thanks.

1

There are 1 answers

1
Buurman On

Basically, the moment you run that command, your java program runs 'in the foreground', which means the rest of your script stops executing until your program exits.

If you want to keep on running the rest of your script while your java program executes you have to run your program in the background. One way to do that is as @Alp suggests:

java -jar Azureus2.jar --ui=console &