What you need to do is have the output of the spawned process redirected to the 
STDOUT and STDERR of the current process. The following should work:

        ProcessBuilder pb = ProcessBuilder.command (“java”, “-Xmx8192m”, “-cp”, 
“MemoryLauncher.jar”, "Project.Main”);
        pb.inheritIO();
        pb.start();

Paul Franz 


> On Sep 18, 2018, at 2:39 AM, A Z <powerus...@live.com.au> wrote:
> 
> I am running Netbeans 9 64 bit on 64 bit Windows 10 Home Edition.
> 
> I am calling an additional full java program from with the source
> code of an initial one, in order to increase the 64 bit memory limit:
> 
> Process process = Runtime.getRuntime().exec("java -Xmx8192m -cp 
> MemoryLauncher.jar Project.Main");   
> 
> I am finding that the console will listen to the main method in the first 
> program,
> but won't listen to the main method in the second program.  Nor does Netbeans 
> 9 seem to have
> an option to do so.
> 
> How can I listen to the other program?  While I can just add this 
> successfully to the end
> of an ordinary program anyway, does the Netbeans console have an option
> to change which java program it displays information from?

Reply via email to