This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I am trying to execute 'ping' command in my linux machine through a java program. I am using the following method to execute the command.
The problem is that the options for the ping command are different for windows and linux.
How can i find the type of the process that is started by the exec(command) method(ie. like UNIXProcess or Win32 process)?
What are the types of processes java uses?(ie. like windows process or linux process or mac process).
How can i get their type?
Shaik Muhammad wrote:
Why runtime instance is not giving os name?
Do you mean "Why didn't they add a method to the Runtime class to tell you the name of the OS?"
Any one of us, I'm sure, can think of hundreds of methods that they might have added to the Java APIs; if all those thousands of methods were added, it would be too bloated to be useable. So although it might make sense for there to be such a method, as you can see, you can still get the information you need without it.