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?
asked Apr 6, 2015 at 6:50
codingsplash
5,08512 gold badges57 silver badges93 bronze badges
1 Answer 1
You need to get InputStream out of the Process and read the input.
Sign up to request clarification or add additional context in comments.
Comments
lang-java