Eclipse Package,source Folder,folder Differences and mutual conversions

Source: Internet
Author: User

The following reference to other blogs, write down their own deep impression:

Under Eclipse, Package,source Folder,folder are all folders.
They differ from the following: package: When you build a package, it is automatically built into the source folder, and can only be built under this directory.
SOURCE folder: Folders that store Java source code, and of course include some package folders, and can contain other files as well. After the project is built, the Java in the source folder is automatically compiled into a class file into the corresponding/web-inf/classes folder, and the other files are moved to the corresponding directory in/web-inf/classes.

 Package and Sourcefolder comparisonsame: The package can contain other files in addition to the Java file, and the compiled, packaged file path has the same rules as the file path under the source folderdifferent: 1.sourceFolder by "/" to the division, the package by "." To divide the hierarchy. 2.source folder can be built under the package, but the package cannot be built under the source folderThe package attribute in the 3.java file is assigned according to the path of the "a", the source folder path does not participate in the Java file's Package property assignment, and the second one concludes that all source The package property of the Java file under folder is empty. folder: It can be placed in any file. Includes Java source files, jar files, other files (e.g., pictures, sounds, etc.). Here I explain that if there is a Java source file inside, regardless of whether the program is correct, Eclipse will not error, Treat them as ordinary files. But if the project is to use the files in it, the situation will be different.
Package,source Folder,folder Convert Package to folder display: Select Package, build path-> Exclude folder to package display : Select folder, Build path-> Include
The package turns to the source folder display: The package is selected, the build path-> use as source folder source folder turns into the package display: Select folder, Bui LD path-> Remove from BuildPath
conversion of Pacage to source folder ibid. to convert a file to a package type, right-click on the file and select Use as Source folder. After compiling, you can use the

Eclipse Package,source Folder,folder Differences and mutual conversions

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.