The Type java. Lang. object cannot be resolved it is indirectly referenced... .

Source: Internet
Author: User

the type JAVA. lang. object cannot be resolved. it is indirectly referenced from required. class files

This problem occurs when you reference JDK projects of different versions in eclipse. This is caused by the application of multiple JDK or JRE versions in your development environment. Eclipse selects the corresponding JRE by default according to the initial development environment. For example, there is an environment project developed by jdk1.4 in eclipse. when you introduce a project developed by jdk1.6 of a later version, the above problems will occur.

The solution is as follows:

Go to window \ preferences \ Java \ Installed jres
Press add --> browse... ---> select JRE installation path strength (My JRE path is D: \ Program Files \ Java \ jre1.6.0 _ 02) ---> OK
Right-click your project, right-click the properties option, and select the libraries tab on the right. ---> click Add library... --->

Select JRE system library... ---> next ---> select the corresponding version JRE under alternate JRE --> finish ---> OK

The above problems can be solved.

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.