i would like to get the systemphysical memory and virtual used amount and free space available.

how i am having some problem using the com.sum.... class.
it is saying am retricted and i can not access this call directly.

these are my codes

java.lang.management.OperatingSystemMXBean mxbean = java.lang.management.ManagementFactory.getOperatin gSystemMXBean();
com.sun.management.OperatingSystemMXBean sunmxbean = (com.sun.management.OperatingSystemMXBean) mxbean;


the code in red is where am getting the error.

i