背景:

当使用jdk的自带的API获取系统信息时,代码中import “com.sun.management.OperatingSystemMXBean”出现报错。

解决方法:

Eclipse默认把这些受访问限制的API设成了ERROR,将其改成Warming即可。

Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning。

相关文章:

  • 2021-12-20
  • 2021-06-16
  • 2021-12-13
  • 2021-10-21
  • 2022-12-23
  • 2021-11-12
  • 2021-11-28
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2021-09-09
  • 2021-05-10
  • 2022-12-23
  • 2021-09-25
  • 2021-06-29
相关资源
相似解决方案