Eclipse Package,source Folder,folder Differences and mutual conversions

Source: Internet
Author: User

Under Eclipse, the package, source folder, and folder are all directories.

Their differences are as follows:
Package: When you build a package, it builds itself into the source folder, and it can only be built under it.

SOURCE folder: The directory where the Java source code is stored, and of course includes some package directories, and can include other files as well.
After the project is built, Java itself in source folder is compiled into a class file to the corresponding/web-inf/classes folder, and the other files are moved to the corresponding folder in/web-inf/classes.

 Package and Sourcefolder comparisonsimilarly: The package can include 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 folder  The package attribute in the 3.java file is assigned according to the path of the bag, the source folder path is not assigned to the package property of the Java file, and then the second is different to get the conclusion, all source The package property of the Java file under folder is empty.

folder: It can be placed in whatever file. Contains Java source files, jar files, other files (such as pictures, sounds, etc.). Here I explain, If it contains Java source files, regardless of whether the program is correct, Eclipse will not give an error, and treat them as ordinary files. But the project assumes that the files in this case are different.  

package,source Folder,folder between each other  
Package turns into folder display: Select Package, Build path-> Exclude
Folder turns into package display: Select folder, Build path-> Include

Package turns to source folder display: Select Package, build path-> use as source folder
source folder turns into package display: Select folder, Build path-> Remove from BuildPath

conversion of Pacage to source folder ibid.

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.