tags:

views:

66

answers:

3

I want to run a java jar file like this:

java -jar spider.jar

how to run it on background on windows

like this on linux:

nohup java -jar spider.jar > /var/tmp/spider.log 2>&1 &

thanks

+3  A: 

On Windows it's not normal that a process terminates once its parent was killed (like Unix-likes do it normally). Therefore there is no direct necessity for something like nohup. If you want to avoid the console window associated with it, you can use javaw but redirection won't work, then.

Joey
See http://stackoverflow.com/questions/1997718/difference-between-java-exe-and-javaw-exe
skaffman
thank you very much!
www
+1  A: 

Have a look at this and this.

thelost
thank you very much!
www
+1  A: 

You could use the Windows start command:

start /min java -jar spider.jar

This command is not really the same as nohup; but it might be suitable if you're happy with the Java process running in a separate minimised window. See http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx

gutch
thanks ...........
www