Eclipse:自动终止(java) [英] Eclipse: auto-terminating(java)

查看:204
本文介绍了Eclipse:自动终止(java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Eclipse中编写代码并运行它第二次时,第一个进程仍在运行。例如,当我写一个无限循环与一些打印,运行一次,然后再次,它正在打印从运行,从第一和第二。此外,Eclipse变得越来越慢。有没有办法在重新运行时自动终止第一个进程?

When I write a code in java in Eclipse and run it for second time, the first process is still running. When I, for example, write an infinite loop with some prints, run it once and then again, it is printing from both running, from the first and second. Plus, Eclipse is getting slow. Is there a way to auto-terminate the first process when re-run?

推荐答案

您可以右键单击调试 - 查看并选择终止和重新启动,这是最接近你想要拥有的,因为它将首先停止当前运行的实例,然后开始一个新的具有相同的设置。

You can right click on the entry in the Debug-View and choose "Terminate and Relaunch", that is the closest I got to what you would like to have as it will first stop the currently running instance and then start a new one with the same settings.

其他从你可能会实现一些你自己的实例,即实例监听的套接字,新的发送关闭命令在它完全启动之前。

Other from that you would probably implement something on your own, i.e. a socket where the instance listens and where the new one sends a shutdown command before it fully starts up.

这篇关于Eclipse:自动终止(java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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