在服务器上不断运行java应用程序 [英] Constantly running java application on server

查看:305
本文介绍了在服务器上不断运行java应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在服务器上不断运行java应用程序。我有sevlets的经验,但他们不经常运行。通过研究我发现这个问题的共同解决方案是使用第三方计时服务;当我编写自己复杂的计时机制时,我对使用其中一个犹豫不决。

I am looking to run a java application constantly on a server. I have experience with sevlets, however they do not run constantly. Through research I have found the common solution to this problem is to use a third party timing service; I am hesitant to use one of these as I coded my own complicated timing mechanism.

此应用程序需要全天候运行;我很困惑为什么人们不经常遇到这个问题 - 我做的事情是愚蠢的吗?

This application needs to be running 24/7; I am confused as to why people don't run into this problem more often - am I doing something stupid?

推荐答案

这个问题似乎是如何让我的程序全天候运行?答案是:

The question seems to be "how do I get my program to run 24/7?" and the answer is:

1。)让您的计算机全天候运行并让程序运行。

1.) leave your computer on 24/7 and let the program run.

2。)将你的程序放在像www.digitalocean.com这样的东西上,每月5美元,然后让程序运行。就像你的电脑一样。

2.) put your program onto something like: www.digitalocean.com for $5 per month and...let the program run. Just like your computer.

William Falcon已经描述过,有很多云主机。

It's already been described by William Falcon, there are many cloud hosts.

To扩展一下,你只需将 MyProgramThatRunsForever.jar 复制到远程服务器上,然后在后台运行它,就像这样。它将运行并运行和运行,无论它做什么......

To expand on that, you just copy MyProgramThatRunsForever.jar over to the remote server, and run it in the background, something like that. It will run and run and run, doing whatever it is that it does...

如果你问一个不同的问题,你会得到更好的答案。我,其中一个,不知道你为什么要这样做,并认为这是个好主意。

If you ask maybe a different question, you will get better answers. I, for one, have no idea why you want to do this and think this is a good idea.

参见:


XY问题,有时被称为是一个心理障碍,
导致大量浪费的时间和精力,两者都是
的人寻求帮助,以及那些提供帮助的人。
通常是这样的:

The X-Y Problem, as it is sometimes called, is a mental block which leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help. It often goes something like this:

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.


XyProblem

XyProblem

http://mywiki.wooledge.org/XyProblem

这篇关于在服务器上不断运行java应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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