Similar question This question had an issue with filename vs classpath. I am using classpath in my program and yet was not getting the output.
I searched a lot through various posts, but I was unable to resolve my error. I have a class file in my D: The file just prints "hello world".
When I run it through command prompt as:
java -cp D:/ Test
it works fine.
But when I run the same inside a main method of another java program as:
Process p = Runtime.getRuntime().exec("java -cp D:/ Test");
I get no output, nor errors. Can someone help me whats going wrong here?