I have an application like the follows,
public class OpenApp {
public static void main(String[] args) {
if(args.length>0)
System.out.println("Hi " + args[0]);
System.in.read();
}
public static String sayHi(){
return "Hi";
}
}
So The OpenApp will be running. I have some other methods. Can I call the sayHi method from another application, without creating new instance of the class.? Because I have some data constrains on running OpenApp.
Please Correct me If my question is wrong. Simply I'm trying to communicate between 2 JVM. So, I read, RMI is the best way to make the communication. So Is there any other way.