用 Java 将多台计算机连接到一个大脑
我想知道哪些库或 API 对此有用。我的目标是能够在提示符中输入命令,然后指定在哪台计算机(在所有联网的计算机中)执行该命令。第二部分是我希望能够在指定的计算机上看到该命令的执行和结果。
例如,如果我输入“firefox www.google.com,desktop2”,我希望能够看到该计算机的显示器上打开的窗口。你明白我想做什么吗?任何帮助表示赞赏。
谢谢,莫菲斯
I was wondering which libraries or API's would be useful in this. what im aiming for is to be able to type a command into a prompt and then specify which computer(out of all of them that are networked together) to execute that command on. the second part is i want to be able to see that command execute and the result on the computer that was specified.
for example if i enter "firefox www.google.com, desktop2" i want to be able to see the window open on the monitor of that computer. Do you understand what im trying to do? any help is appreciated.
Thanks, Morpheous
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我会,但不知道为什么。例如,现有的机制可以做到这一点。如果您在每台“多台计算机”上运行 sshd,您可以简单地从“控制”运行:,
然后您将使用远程 X 将 Firefox 转发回本地桌面(实际上是在桌面 2 上执行)。尝试
man ssh
了解更多信息,如果您想了解更多信息,请询问 serverfault。如果你想开发一些东西来实现这种想法,那就是另一回事了,我会质疑 Java 是否是实现这一目标的最佳方法(意见各不相同,但它不是一种“系统语言”)。同样,现有的解决方案是存在的,例如用于 Fedora 等项目的构建系统(请参阅 Koji)。
我的建议是研究大量现有代码,只有当这不能解决您的问题或者您想要挑战时,才编写新的代码。
I think I do, but not why. For example, there are existing mechanisms for doing this. If you've got sshd running on each of your "multiple computers" you could simply, from "control", run:
and you'd use remote X to forward firefox back to your local desktop (actually being executed on desktop2). Try
man ssh
for more information and ask on serverfault if you want to know more.If you're looking to develop something that achieves this sort of idea, that's a different matter and I'd question if Java is the best way to do it (opinions vary but it's not a "systems language"). Again, existing solutions exist such as the build systems used for projects like Fedora (see Koji).
My advice would be to research a lot of existing code and only if this doesn't solve your problem or if you want a challenge, write something new.
在 Windows 上,PSExec 将执行此操作:
命令行为
例如:
将在远程计算机上以交互方式执行 firefox。
看
- PSExec、Microsoft PStools
On Windows, PSExec will do that:
The command line is
For example:
Will execute firefox interactively on the remote computer.
See
- PSExec, Microsoft PStools