[英]How to find and execute a method on another java application currently running on computer using java?
For example, lets say I have hello.java (arbitrarily), if it was running and user changed some accessible (not private) variable in that application by providing input while running, this application would have the variable different compared to one not executed yet. 例如,假设我有hello.java(任意),如果它正在运行并且用户通过在运行时提供输入来更改了该应用程序中的一些可访问(非私有)变量,则该应用程序的变量将与尚未执行的变量不同。 And another program (preferably java) can get or show the updated information on that variable from that application. 另一个程序(最好是java)可以从该应用程序获取或显示有关该变量的更新信息。
A variable holds a piece of information in memory. 变量在内存中保存一条信息。 If you want to make it accessible from another program, you have two choices : 如果要使其可从另一个程序访问,则有两种选择:
Yours is the problem of accessing an object in a JVM remotely. 您的问题是远程访问JVM中的对象。 RMI seems good choice for this. RMI似乎是个不错的选择。
Here there will be two parts to your application 在这里,您的应用程序将分为两部分
There are many good tutorial including the Wiki link above. 有很多很好的教程,包括上面的Wiki链接。 Check this out. 检查这个出来。
$1 and $2 require some modification of controlled application. $ 1和$ 2需要对受控应用程序进行一些修改。 $3 and $4 do not require any modification of your applcation. $ 3和$ 4不需要修改您的申请。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.