Thanks for all your replies. I guess, i didnot ask the question properly.
My question is " I already wrote a Java program with infinate loop.But how can i make this job as a cron/ scheduled job / some job so that, it has to run always in the server. I should be able to start/stop the process and close the command prompt. How can i do this??
There are several ways to run Java programs as Windows services, that start when Windows starts. Search for "java windows service" on Google.
On Unix or Linux, you can add a startup script somewhere in the /etc folder to start your program at boot. How this works exactly depends on what flavour of Unix or Linux you're using (read the documentation of your OS).