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 OperatingSystemMXBean is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
From this line of code...
com.sun.management.OperatingSystemMXBean bean = (com.sun.management.OperatingSystemMXBean) java.lang.management.ManagementFactory.getOperatingSystemMXBean();
I've found ways around this but I'm worried about the restriction warning. This code is for my open source project (CfTracker) and I don't want to work around this restriction if I'm going to be breaking some sort of license agreement. Can anyone help me understand this?
Go to Window-->Preferences-->Java-->Compiler-->Error/Warnings. Select Deprecated and Restricted API. Change it to warning. Change forbidden and Discouraged Reference and change it to warning. (or as your need.)
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With