This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes General Computing and the fly likes running java on remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "running java on remote server" Watch "running java on remote server" New topic

running java on remote server

robert peach

Joined: Apr 27, 2013
Posts: 2

I have recently written a programme which I hope to run continuously on a remote server so that it can constantly send updated information to my friends (as opposed to running on my home computer non-stop). I have been playing around with using tomcat in eclipse, and I can get my programme to run on localhost.

I'm not overly good at networking etc, so my question is whether it is possible to merely rent a web server and have my programme run continuously (just looped) on it? Then I could connect to the web server from my home computer when I need to make changes to the programme etc. If this is possible, what route should I take?

chan wenbi

Joined: Apr 05, 2013
Posts: 1
i am sure that you could rent machine as web server. Certainly you are also apply Google App Engine (GAE)to running your application. If you are going to update application, then to redeploy by GAE tools.
robert peach

Joined: Apr 27, 2013
Posts: 2
Ok I have looked at google app engine as you recommended, it seems to be able to do the job.

I do have a couple of questions regarding it, however. Is it possible, once I have deployed the project to run as a web application, that one of the java classes can run continuously on a loop without the need for a request from a user. The looping program would then constantly update the datastore with an array of information. A java class that allows the user to correspond with the webserver would then be able to collect information from the datastore and use it.

How would I get a program to run continuously without the need of a user request?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
For running background jobs check out the java.util.Timer and TimerTask classes. They can be started from a ContextListener (assuming that GAE supports either of these classes - I have no idea).

GAE imposes certain limitations on your web apps, though. Maybe more standard hosting providers like those listed in would be more appropriate. Hard to say from the description, though.
I agree. Here's the link:
subject: running java on remote server
It's not a secret anymore!