Co-development, import MyEclipse Project error problem

Source: Internet
Author: User

For work reasons, my colleague handed over his Java project to me. The same as the usual handover. He put his latest source code into a zipped package and sent it to me. After I unzip, I use the MyEclipse development tool, import, import the project into my development tools, this time there is a problem, there is a red fork on the project. The source code does not have any errors. Because the code is in the co-worker, everything is fine. As shown in the following:

I have been looking for a long time reason, is really not easy to find, this morning, I was looking for, finally in the CSDN forum, see a post, to this did a reply. Post address is: http://bbs.csdn.net/topics/310268011 through this post, I seem to be enlightened, is it because of the jar package, the environment is a problem? Based on the above tips, I would like to first delete my original referenced jar package, reload it, and see the effect of the test. As a result, that is really the reason. After thinking, know the reason: The reason is that when the project source code, passed to others, the file may be stored in different paths, resulting in, although the library jar loading, seemingly normal, in fact, not normal (General library jar package, placed in the Lib directory).
I'll show you first, reload my compilation path before I right-click your project-Build path-configure path ... On the Libraries tab, you can obviously see the jar of my library as follows:

The red circled, and we were thrilling to see the relative path of the reference. But this is where the problem arises. At this point, you select the jar package in addition to the JDK, click the Remove button on the right side to remove these referenced jar packages, as I removed the effect as follows, you can according to your actual situation, the JAR package removal operation:

After removing the jar package, the next step, of course, is to reload the jar package, click on the right side of the add External JARs ... button, select the directory where you just removed the jar package, and reload the jar package required by the project. The effect of reloading the jar package is as follows:

This time, you can clearly see, before and after the difference between loading, one is a relative path, one is an absolute path. Click the OK button. Are you looking at this time that your project is normal? After my project is reset, it is normal, as follows:

Co-development, import MyEclipse Project error problem

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.