Access restriction: The type * is not accessible due to restrict. An error is reported. Only the second type is tried. OK.

Source: Internet
Author: User
Error message: access restriction: the constructor sunjce () is not accessible due to restriction on required library c: \ Program Files \ Java \ jre7 \ Lib \ ext \ sunjce_provider.jar


Access restriction: The type tasktopicresolver is not accessible due to restrict when performing NC, I copied a nc_demo from someone else and returned an error.
Import NC. BS. wfengine. Engine. Ext. tasktopicresolver;  

Error message: access restriction: The type tasktopicresolver is not accessible due to restriction on required library nc_demo/nc_home/modules/UAP/META-INF/lib/uapplatform. Jar

Solution 1:

By default, eclipse sets these access-restricted APIs as error.
Windows-> preferences-> JAVA-> compiler-> errors/warnings->
Deprecated and trstricted API-> forbidden reference (access rules):-> change to warning

Solution 2:
You only need to remove the JRE System Library first in the Project Build path, and then add the library JRE system library. After re-compilation, everything will be normal.
(I have used this method only, but I do not like other methods)

Solution 3:

Right-click the project-> project properties-> JAVA builder path-> libraries tag, click access rules in the JRE system library, and add sun/** to accessible. If this option exists, edit.

Solution 4:

Windows-> preferences-> JAVA-> installed jres-> select JDK for use-> edit-> Add external jars

I tried 1, 4 feasibility... I am only mine. I have not studied the specific differences. Who has the research to send a message?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.