如何停止在intelliJ中运行的处理,以便它调用关闭钩子? [英] How do I stop a processing running in intelliJ such that it calls the shutdown hooks?

查看:2135
本文介绍了如何停止在intelliJ中运行的处理,以便它调用关闭钩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在intelliJ中运行我的程序然后使用STOP按钮时,它不会调用我创建的关闭钩子。有没有一种方法可以让那些叫做关闭的人?

When I run my program in intelliJ then using the STOP button it does not call my shutdown hooks that I've created. Is there a way in intelliJ to have those called on shutdown?

谢谢

推荐答案

您需要使用运行面板中的退出按钮,而不是停止按钮。请注意,它仅在运行时有效,并且在调试时不起作用。

You need to use the Exit button in the Run panel, not the Stop button. Note that it will only work when Running and will not work when Debugging.

如果您找不到它,请截图:

Here is the screenshot if you can't find it:

这个功能使用特定于平台的代码,目前仅适用于Windows和Linux。 修复 IDEA-56273 后,此功能也应在Mac上提供。 它在IDEA的10.5版本中修复。

This feature uses platform specific code and currently works on Windows and Linux only. Once IDEA-56273 is fixed, this feature should be also available on Mac. It is fixed in 10.5 version of IDEA.

这篇关于如何停止在intelliJ中运行的处理,以便它调用关闭钩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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