Exception in thread "main" java. Lang. linkageerror Solution

Source: Internet
Author: User

Debug with myeclipseCodeWe often add the main method to the Java file for debugging. Sometimes the following errors may occur due to package compatibility problems, resulting in debugging failure:
**************************************** **********************
Exception in thread "Main" Java. lang. linkageerror: jaxb 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar: file:/D:/workspace/a8_common/webapp/WEB-INF/lib/jaxb-impl.jar! /COM/Sun/XML/bind/v2/model/impl/modelbuilder. Class)
Needs 2.1 API. Use the endorsed directory mechanics to place jaxb-api.jar In the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards)
**************************************** **********************
Solution: first, output the directory of the compatible package in the main function:
System. Out. println (system. getproperty ("Java. endorsed. dirs "));
My path is c: \ Program Files \ Java \ jdk1.6.0 \ JRE \ Lib \ endorsed
Then create the endorsed folder on the upper layer of this directory (here is the lib directory), copy the file jaxb-api.jar to the endorsed folder, OK to get it done

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.