I\'m having a little trouble with some Java code I\'m trying to compile in Eclipse. I keep getting the following warning...
Access restriction: The type Ope
This is not a problem of license agreements. It is just Eclipse trying to protect you from using classes that are not part of the official JDK API (but rather, part of Oracle/Sun's JVM implementation).
Is there a particular reason that you need to class cast (rather than using the "official" interface java.lang.management.OperatingSystemMXBean)?
If you want to make sure that your application continues to run when the expected MXBean is not available, you could add some try/catch logic to gracefully handle a ClassCastException.