David Newton wrote:What was wrong with your idea of passing the objects to the constructor?
I thought that the only way to start a new process in java is to use Runtime or ProcessBuilder. Let me know if I'm wrong, but I thought that all you can pass to Runtime or ProcessBuilder are String arguments.
Than if you call Runtime.exec (ProcessBuilder.start), all string arguments are passed to static void main.
Since I don't know the solution of my problem perhaps I didn't make myself clear - I don't know how this can be achieved, but I need to execute a class in a separate process and I need to pass an Object arguments to the constructor.