0

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?

0

1 Answer 1

0

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.