Windows 上的 nohup 是什么? [英] What's the nohup on Windows?

查看:105
本文介绍了Windows 上的 nohup 是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想像这样运行一个 Java jar 文件:

I want to run a Java jar file like this:

java -jar spider.jar

如何在 Windows 的后台运行它?

How to run it on the background on Windows?

在 Linux 上是这样的:

Like this on Linux:

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

推荐答案

在 Windows 上,进程在其父进程被杀死后终止是不正常的(就像 Unix 类的正常情况一样).因此,对于像 nohup 这样的东西没有直接的必要性.如果您想避开与之关联的控制台窗口,您可以使用 javaw 但重定向将不起作用.

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.

这篇关于Windows 上的 nohup 是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆