Path Problems Caused by source folder in eclipse

Source: Internet
Author: User

Source folder is the path to put the class file in eclipse, and SRC is the source folder that everyone is familiar.

When we release the program, the. java files under SRC are all compiled into the. Class file into the WEB-INF \ Classes folder.

You can also create a source folder with a casual name, but remember that the content in it was finally published under the WEB-INF \ Classes folder.

This is not what I want to talk about. I want to talk about Path Problems.

For example, if you create a source folder named Cong and put some configuration files in it, when other configuration files reference the items in Conf,

The path is the WEB-INF \ Classes. That is to say, the path of the conf object is the path of SRC!

You can check that after the program is released, the items in the conf file are put together with those in the SRC file, and there is no conf folder!

Therefore, we can think that the source folder is not created after the source folder is created. Visually, we feel that there is another folder,

In this way, we manage our things, but the things in it are put together with things under SRC. We think that all source folder is a SRC.

Therefore, you can solve the path problem according to the SRC path. (You can ignore the source folder you created ).

Note that the source folder can only put the. Java file, and finally compiled into the class file into the WEB-INF \ Classes.

Of course you can put other files, such as XML files, above I also said these files and. java files together under the WEB-INF \ Classes.

The difference is that if you put the. Java file, you can create a package. (If you have created a folder, it will automatically become a package, because it was originally intended to put a Java file)

Java in the package can be compiled and published at the time of release. However, files in other formats can only be placed under source folder. If you put files in a package,

Eclipse does not know, and has not released this file. You can go to the server to check whether there is any file you want. Therefore, files in other formats must be placed in

In the source folder, do not create a level-2 directory. Eclipse does not know it. It only recognizes java files in the package directory.

After talking about this, we have a clear understanding of source folder. It was originally designed for java files, just like package.

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.