wood burning stoves*
The moose likes Java in General and the fly likes Running a  Runnable Jar File on Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Running a  Runnable Jar File on Server " Watch "Running a  Runnable Jar File on Server " New topic
Author

Running a Runnable Jar File on Server

Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Hi,
I need to run my runnable Jar file on a Web Server. Once the Server is started, the main class should be called. How do I do that?

Many Thanks
Have a nice day
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

Maya sekar wrote:Hi,
I need to run my runnable Jar file on a Web Server. Once the Server is started, the main class should be called. How do I do that?

Many Thanks
Have a nice day


How can you run a jar file on a web server. jar file is just a java archive containing object code. is it like that you have a war file which wants to call jar application. please be more clear?
Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Hi Gurpreet,

Thank you for your response. I need a jar file packed along with my war file.... a jar that has a main class i.e a runnable jar file.. once the server is started, the main class needs to load and run...

Many thanks...
Have a nice day
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

you can write a shell script if you are using linux or you can write batch file if you have windows system. this script can start your jar file whenever the server is started.
Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Hi Gurpreet ,

Thank you for the response. I did think of that. But you see I need it to be independent of the Operating System. So neither a shell script nor a windows scheduler is an option....

thanks again,
Have a nice day
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Running a Runnable Jar File on Server