Access restriction in java

I have this import in my code:

import com.sun.jmx.snmp.SnmpOidDatabaseSupport; 

but I get the following error:

 Access restriction: the type SnmpOidDatabaseSupport is not accessible due to restriction on required C:\Program Files\Java\jre6\lib\rt.jar 

and also, if this can help my eclipse IDE, how can I fix this error?

+6
source share
2 answers

Have a look here: Limiting access to the class due to restrictions on the required rt.jar library?

This is not an exact duplicate of your question, but some answers are relevant. Here are the quotes:

http://www.digizol.com/2008/09/eclipse-access-restriction-on-library.html worked best for me.

Windows β†’ Settings β†’ Java β†’ Compiler β†’ Errors / Warnings β†’ Deprecated and trstricted API β†’ Forbidden link (access rules): β†’ change warning

If you think this answer is useful, be sure to re-read the answer that I provided here. Follow the link above and find @scommab for the answer

+7
source

As you link to the library in the Program Files folder, you cannot run eclipse with administrator privileges. try running eclipse with administrator privileges.

or can you follow this message Restricting access to the class due to restrictions on the required rt.jar library?

0
source

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


All Articles