I am trying to work on a project which involves running/executing the java file in three JVM on different Network. If i locally run the Java file should simultaneously should run in all three or two JVM.
For example :/usr/local/helloWorld.java
class HelloWorld {
    public static void main(String args[]){
         System.out.println("Hello World");
     }
   }  
When i run this /usr/local/$java helloWorld  This should  print  Hello World in JVM1(locally), JVM2(which is Remote) . 
Is there way to say remote machine JVM2 that path for class file is located  at  /usr/local/ execute the file from there ?.
or
Should i run $java helloWorld in remote machine also  ?
Thanks