简体   繁体   中英

execute .jar file on windows server with shell script from linux

I have application packaged into .jar file on windows server. I want this application to run every 3 seconds. how can I achieve this?

I was planning to write shell script on linux server, remotely log into windows server and execute .jar file but the problem is windows server and linux server are on different VLANs which have been prevented from communicating. so i couldn't even test if my silution is working.

your urgent help please. this has to be delivered before end of business tomorrow

Windows should have an scheduler, doesn´t it??

Whatever, you can add a code in your jar to make it execute what you want evey 3 secods. You can do in about 2 lines. Timer timer = new Timer(); timer.scheduleAtFixedRate(new MyTimer(), 3000, 3000); and let it running... the MyTimer class has to extend TimerTask (and implement run method). Put the stuff u want your program to do in the run method. It could also start the other jar file you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM