Please suggest how thius can be achieved and best approach to follow.
a) Suppose server1 have application which is started using "java -Xmx512M -jar <app1>.jar" from command prompt from particular directory example C:\proj\application1>
Based on certain condition I want to stop this <app1>.jar on server1 and
b) Start app.jar on server2 using "java -Xmx2G -jar <app2>.jar" on server 2 from particular directory example C:\proj\application2>
c) Then start "<app1>.jar" on server1 once <app2>.jar finishes some processing.