From your comments it seems that your command should probably look like
java -cp c:\users test
so try changing your code to something like
Process p1 = Runtime.getRuntime().exec("java -cp c:\\users " + exec);
where exec
should pass full.package.name.of.YourClass
which in your case is most probably test
(not test.class
or test.java
).