Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to access com.sun.management.OperatingSystemMXBean in eclipse

 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use jre6 and it can access the sun.management.ManagementFactory and com.sun.management.OperatingSystemMXBean

but when im using se jre-7, it would not allowed. access restriction.

im trying download back the jre6 or do anything to make sure it can access but still it wont happen. is there anyway? please.. im really hoping i could use this MXBean
 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there another way? i found one of the solution it said that just configure the setting from error to warning. but that is only make the error invisible, not to access.

is there another way to use the mxbean, anyone?
 
Campbell Ritchie
Sheriff
Posts: 48402
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does changing error to warning mean? Is it an option on your IDE?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not supposed to use classes in the sun.* and com.sun.* packages. They are not part of the public API, and as you've experienced they could be changed by Oracle in any new version.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic