is it possible to do such a thing like to get some static data in one java process from another:
I have 2 java applications.
Application 1
public static String hello;
public static void string main(String[] args) {
hello = "hello";
}
Application 2
public static void string main(String[] args) {
String hello = someHowTakeInitializedHelloPropertyFromApplication1()
}
1 Answer 1
You cannot access objects in the memory space of another process running a JVM. If you need access to any data from another process, make the class that represents that data serializable, and provide an API in the other process to make serialized object available to other processes.
This Q&A discusses options for sharing information across JVMs. For your situation when a very small amount of information needs to be shared, coding a managed bean using Java Management Extensions may be an expedient option.