This is the only info I get:
ExecDemo.java:20: cannot find symbol
symbol : method exec(java.lang.String,java.lang.String)
location: class java.lang.Runtime
p = r.exec("top" , "-n1");...
Type: Posts; User: hooshdar3
This is the only info I get:
ExecDemo.java:20: cannot find symbol
symbol : method exec(java.lang.String,java.lang.String)
location: class java.lang.Runtime
p = r.exec("top" , "-n1");...
exec("top", "-n1"); errors at compile time
I expect the same output as when exdecuting free-m or top -n1 from the command prompt/terminal
--- Update ---
I look for a call similar to C++ system(), most efficient.
I called waitFor() for the 2nd instance of the process, but nothing appeared at the output.
Similar;y, I wrote:
again, with no result whatsoever.
This is my screen output:
Hello.
I get a run-time error executing my code. Can anyone tell me why?
Thanks in advance
Here is my class with main():
class ExecDemo{
// Date d = new Date();