package java.lang.management does not exist

Mandy Chung mandy.chung at oracle.com
Fri Jan 9 03:34:50 UTC 2015


On 1/8/2015 7:01 PM, Pete Brunet wrote:
> Hi, I'd like to use
> java.lang.management.ManagementFactory.getThreadMXBean.dumpAllThreads(true,
> true) but when building I get package java.lang.management does not
> exist.  Is there a way to get the build to find this package?  Or is
> there alternative to the dumpAllThreads method in some other package?

Do you see 
BUILD_OUTPUTDIR/jdk/modules/java.management/java/lang/management/ManagementFactory.class 
in your jdk build?

There is a typo in your statement above - should be getThreadMXBean()
- missing "()" would that be the reason?

    ManagementFactory.getThreadMXBean().dumpAllThreads(true, true);

Mandy


More information about the jdk9-dev mailing list