1

I have to execute a java application on a remote server through command line.

I normally run the application like:

java -jar /home/user/files/simulator.jar -nogui:/home/user/files/my-sims/sim1.csc

this prints in my terminal a lot of compilation outputs, and during the simulation it prints the simulation time remaining every 1% increase of the simulation progress.

Obviously, during the simulation the terminal is unusable due to these outputs.

I tried to run the application with a & at the end to run it in background, like:

java -jar /home/user/files/simulator.jar -nogui:/home/user/files/my-sims/sim1.csc &

but the compilation outputs are printed anyway, so I cannot use the terminal to logout from the server.

How can I solve?

Thanks

3
  • what about piping the output to /dev/null? java -jar ... 2>&/dev/null Commented May 17, 2013 at 17:42
  • What platform are you in? Commented May 17, 2013 at 17:43
  • @Mohayemin Ubuntu 12.04 Commented May 17, 2013 at 17:44

1 Answer 1

1

On linux, direct the output to /dev/null

java -jar /home/user/files/simulator.jar -nogui:/home/user/files/my-sims/sim1.csc > /dev/null

To skip the errors on consol, add an &

java -jar /home/user/files/simulator.jar -nogui:/home/user/files/my-sims/sim1.csc &> /dev/null

The answer is borrowed from serverfault.

Sign up to request clarification or add additional context in comments.

4 Comments

@aliants: What do you mean by terminal locked? Are the outputs still printed?
It doesn't return to user@user-VPCEB4B4E but it remains the rectangular character blinking (sorry for my bad explanation but I'm not able to tell it in english).
Ok, I solved with another & at the end. java -jar /home/user/files/simulator.jar -nogui:/home/user/files/my-sims/sim1.csc &> /dev/null & Thanks a lot.
Well yes, that will run your program in background.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.