Failed to import org.sun.management.OperatingSystemMXBean in java class?

I can see org.sun.managementin the JRE System library, but I am unable to import it into eclipse. Any reasons why this is permitted. even maven compilation

here are the screenshots.

enter image description here

enter image description here

I use Java 8.

I am trying to do this:

if (operatingSystemBean  instanceof com.sun.mananagement.OperatingSystemMXBean) {


        })
+4
source share
2 answers

Eclipse does not allow you to access the details of the Sun implementation, as this will not be portable to other JVMs.

You can change the project settings so that Eclipse treats this type of problem as a warning and not as an error.

My actions for the latest Eclipse on Mac:

-   - > Java       - > /           - >               - > API                   - > :

+7

mananagement -

-1

Source: https://habr.com/ru/post/1607729/


All Articles