I am trying to run the JUnit Test program through the command line from Java application. In java file, I am using the following commands,
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("java -jar map.jar time.rel test.txt debug");
In the exec function, I am adding the following command to run the Junit,
java -cp cp.txt org.junit.runner.JUnitCore Testing
In place of cp.txt, I gave the classpath which is very long and this approach throws me the following error,
Cannot run program "java": CreateProcess error=206, The filename or extension is too long
So I want to place the string in cp.txt and give it as classpath in the command. Any help would be greatly appreciated. TIA