Eclipse and Java: Using ProcessBuilder gives Error: Could not find or load main class -


i have master.java class spawning 2 types processes (server.java , client.java) this:

to start process server.java (which has main)

string[] servercmd = {"java", "server"}  processbuilder pb = new processbuilder(servercmd); pb.inheritio(); process p = pb.start(); 

to start process client.java (which has main)

string[] servercmd = {"java", "client"}  processbuilder pb = new processbuilder(servercmd); pb.inheritio(); process p = pb.start(); 

once starts run errors this:

error: not find or load main class server error: not find or load main class client

all 3 of these files master.java client.java server.java in same folder.

does know how fix error or how configure eclipse handle it?

i don't have best answer on this, use debugger , step through process. way can see when it's failing. also, check see arguments allowing more 1 argument @ time. example: run program , have fail. within eclipse click on 'run' tab @ top, click 'run configurations'. 'arguments' tab , see have set each item can ran @ same time. again, i'm not expert processbuilder, sounds operating more 1 item @ time.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -