Let say we are in a java execution and the program must to create an instance of an object in another jvm (the cause is not important here: Could be memory limits or problems with static attributes) How can I do that? I know that Runtime.getRuntime().exec("java ClassName") could do that, but I would preffer better solutions. Anyone know how?
You could set up some kind of RMI service in the other JVM, and use it to create objects. This give you the option to move the other JVM to a remote machine if need be.