我希望在服务器上不断运行Java应用程序。我对sevlet有经验,但是它们不能持续运行。通过研究,我发现解决此问题的常见方法是使用第三方计时服务。我在编码自己复杂的计时机制时犹豫使用其中之一。
该应用程序需要24/7全天候运行;我对人们为什么不经常遇到这个问题感到困惑-我是不是在做一些愚蠢的事情?
问题似乎是“我如何让我的程序运行24/7?” 答案是:
1.)将计算机保持24/7状态,然后让程序运行。
2.)将您的程序放到以下网站上:www.digitalocean.com,每月5美元,然后…运行程序。就像您的计算机一样。
William Falcon已经描述了它,其中有许多云主机。
要对此进行扩展,您只需将其复制MyProgramThatRunsForever.jar到远程服务器,然后在后台运行它,就像这样。它会运行,然后运行,运行它所做的一切……
MyProgramThatRunsForever.jar
如果您提出其他问题,您将获得更好的答案。我不知道为什么要这么做,并认为这是一个好主意。
看到:
XY问题(有时称为XY问题)是一种心理障碍,会导致大量的时间和精力浪费,无论是在寻求帮助的人还是在提供帮助的人中。它通常是这样的: User wants to do X. User doesn't know how to do X, but thinks they can fumble their way to a solution if they can just manage to do Y. User doesn’t know how to do Y either. User asks for help with Y. Others try to help user with Y, but are confused because Y seems like a strange problem to want to solve. After much interaction and wasted time, it finally becomes clear that the user really wants help with X, and that Y wasn’t even a suitable solution for X.
XY问题(有时称为XY问题)是一种心理障碍,会导致大量的时间和精力浪费,无论是在寻求帮助的人还是在提供帮助的人中。它通常是这样的:
User wants to do X. User doesn't know how to do X, but thinks they can fumble their way to a
solution if they can just manage to do Y. User doesn’t know how to do Y either. User asks for help with Y. Others try to help user with Y, but are confused because Y seems like a strange problem to want to solve. After much interaction and wasted time, it finally becomes clear that the user really wants help with X, and that Y wasn’t even a suitable solution for X.
Xy问题
http://mywiki.wooledge.org/XyProblem