'Street.class' in my Eclipse project is located in \ bin in a workaround for packages. The following is the error from the stderror of the created process; I thought Runtime.exec would have come first if it hadn’t been found ... what about this?
Code that launches the Street process:
Process process = runtime.exec("java -classpath \\bin trafficcircle.Street 1 2");
Where is the "Street":
public class Street { public static void main(String[] args) { System.out.println(args[0]); System.out.println(args[1]); System.out.flush(); } }
The process is printing:
Error: could not find or load the main class trafficcircle.Street
Process exitValue: 1
And yes, this works on the cmd line:
C: \ Users \ Brent> java -classpath "D: \ Java Programs \ IPCTrafficCircle \ bin" trafficcircle.Street 1 2
source share