I need to run the Top Unix utility from within Java. I have tried to
run top using the following code, but keep on getting the run time
exception, "Exception in thread "main" java.lang.NoSuchMethodError:
main".
I'm using the following *code*:
public class TopRunner
{
public static void main (String args)
{
try
{
Runtime.getRuntime().exec("/usr/bin/top >>
out.txt");
}
catch (IOException ioe)
{
System.out.println(ioe.getMessage());
}
}
}