Eclipse default Classpath

Source: Internet
Author: User

Eclipse's default classpath consists of three parts:
1, the bin directory of the JDK;
2. All other jar package paths referenced by the project
3. Project Root path (yes, not bin path)

With Eclipse's export jar capability, the bin directory will be the root of the jar, not the project directory on the upper level of the bin, so that the package path of the class is correct, and the resource files, configuration files, etc. in the project directory are also copied here. That is equivalent to the project directory to copy these files to the bin directory before packaging, so that the relative path of the file will be in line with the default classpath.

It can be summed up from the above: When Eclipse runs directly, it takes the project's root directory as the base directory. When packaged as a jar runtime, the bin directory is used as the base directory. The difference between the two levels of the directory, if not understood, may lead to errors. I hope you will pay attention.

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.