I am trying to upgrade an eclipse project from jdk 1.6 to jdk 1.7 .
The following error shows up during compilation for
import sun.management.ManagementFactory;
The type sun.management.ManagementFactory
is not visible.
I tried importing java.lang.management.ManagementFactory
to resolve the error; but then the following line of code is throwing an error.
ManagementFactory.getDiagnosticMXBean().dumpHeap
Error :
The method getDiagnosticMXBean() is undefined for the type ManagementFactory
.
Can someone please help understand what is causing this issue and how to resolve it?