如何在其他网络中存在的远程JVM中运行Java文件/项目? [英] How to run a java file/project in remote JVM which is present in other Network?

查看:66
本文介绍了如何在其他网络中存在的远程JVM中运行Java文件/项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试一个项目,该项目涉及在不同网络上的三个JVM中运行/执行Java文件.如果我在本地运行,则Java文件应同时在所有三个或两个JVM中运行.

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.

例如:/usr/local/helloWorld.java

For example :/usr/local/helloWorld.java

class HelloWorld {

    public static void main(String args[]){
         System.out.println("Hello World");
     }

   }  

当我运行此/usr/local/$java helloWorld时,这应该在JVM1(本地),JVM2(远程)中打印Hello World.

When i run this /usr/local/$java helloWorld This should print Hello World in JVM1(locally), JVM2(which is Remote) .

是否可以说远程机器JVM2类文件的路径位于/usr/local/处,从那里执行文件?.

Is there way to say remote machine JVM2 that path for class file is located at /usr/local/ execute the file from there ?.

我也应该在远程计算机上运行$java helloWorld吗?

Should i run $java helloWorld in remote machine also ?

谢谢

推荐答案

普通Java尚不具备在多台机器上调用和同步多个JVM的机制.

Plain Java does not have the mechanism readily available to invoke and synchronize multiple JVM's on multiple machines.

我建议根据您的需要研究支持Java或Terracotta的开源版本的网格平台.

I would suggest looking into a grid platform supporting Java or the Open Source version of Terracotta depending on what you need to do.

http://www.terracotta.org/web/display/orgsite/Home

这篇关于如何在其他网络中存在的远程JVM中运行Java文件/项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆