Spring tool suite compilation failed: Access restriction: The type XXX is n

Source: Internet
Author: User

I. problems discovered through jaxb operating xml, when javax. xml. bind related packages are introduced, spring tool suite compilation fails. Ii. Analysis of the Cause: Spring tool suite is installed with a spring plug-in eclipse, which is essentially eclipse. By default, Eclipse sets some access-restricted APIs as ERROR ., Therefore, compilation fails. Iii. solution 1: set the level of some restricted APIs to warningWindows> Preferences> Java> Compiler> Errors/Warnings> Deprecated and trstricted API> Forbidden reference (access rules ): -> change to warning. Method 2: In the project build path, remove the JRE System Library, add the Library JRE System Library, and recompile the Library. Method 3: Right-click the project and choose Project Properties> ja. Va builder path-> Libraries tag, click Access rules in the JRE System Library, and add sun/** to accessible. If this option exists, edit. Method 4: Windows> Preferences> Java> Installed JREs> select JDK> Edit> Add External JARs. 4. Summarize the two methods that can be implemented in my experiment. Some other methods are available on the Internet. Please try them yourself.

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.