Problems caused by ECLIPSE class loading mechanism

Source: Internet
Author: User

Apart from the core class, eclipse functions are provided by plug-ins. Plug-ins often expand to each other, and these plug-ins will inevitably use each other's classes. Eclipse assigns a classloader to each plug-in to load the class. By default, classes in different plug-ins of eclipse are invisible to each other.

In either case, the Eclipse plug-in may use classes of other plug-ins. First, add the plug-in dependence directly, and thenProgram. Then, use the value of extension point elemen T as the class name to load a class. Both find the classloader of the plugin where the class is located at runtime, load the class, and return.

Problems:

Class version conflict. In a plug-in, classes with the same name are loaded in different ways, and errors will occur when obfuscation is used. It is best to use an interface, and this interface class must come from the same place.

Class export. A plug-in can be used to configure the classes that require export at runtime. If these classes are not configured, the compilation may fail. Some classes may fail to be loaded, or some classes may be loaded from an unwanted plug-in.

Related Article

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.