문제

Hi all i want to run a java application as backend process.that is like tomcat server.For that i had developed one application.and made one class as main class and calling from one script file .i.e(startup.sh) file.in startup.sh file i was calling one class.that is MainMethodClass.In main method class i had written my business logic.when i am running this app in linux server from using putty is is working until putty window is not closed.As closed after putty window it is also stopped.but i need to run this app even i closed also.How can i achieve this.

도움이 되었습니까?

해결책

Nohup will detach a process you run from your current console and let it continue when you close the terminal. Run something like this.

nohup java -jar my.jar &

By default it will pipe the output to nohup.out, so if you don't want that you could try:

nohup java -jar my.jar > /dev/null &

다른 팁

This problem is not related to java, its actually something related to the way linux operates.

You need to do following:

nohup <your_application_command> &

Note the "nohup" and "&" at start and end respectively.

You should be able to do something like:

nohup java -jar MyApplication.jar &
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top