Call one Java Program from another Java Program
I have 2 Java Programs on 2 different machines , say J1 and J2 Programs on M1 and M2 Machines respectively..
I want to call the J2 Program on M2 to be called by J1 Program on M1 ..
Could someone please suggest someways to do that ?
One of the possible ways I could think if J1 Program is logging through ssh on M2 and call the Java Program J2 , but as I need information to be passed between the 2 programs at different intervals i.e. one program should wait for an input from another program (sometimes J1 has to wait for some information from J2 and vice-versa) , I need some way I could achieve this ..
I will be grateful if someone could suggest some tutorial where I could see this happen , or suggest something that could help me out ..
Looking forward to your response.