如何取消use as source folder

不小心点到build path中的Use as Source folder,如何取消呢?

选择build path-> Remove from BuildPath 

延伸:

每次建java Project或web Project的时候都会有一个src文件夹,这个文件加就是下面所说的source folder,下面可以新建多个package。

1、source folder:存放java源代码的文件夹,当然也包括一些package文件夹,还可以包含其他文件.  
项目构建后,source folder里面的java自动编译成class文件到相应的/web-inf/classes文件夹中,其他文件也会移到/web-inf/classes相应的目录下.  

2、source folder下能建package,而package下不能建source folder

package:当你在建立一个package时,它自动建立到source folder下,也只能建立在这个目录之下.  

3、folder: 里面可以放入任何文件.

package和sourceFolder比较
相同之处:
package下除了java文件也可以包含其他文件,而且编译、打包后的文件路径与source folder下的文件路径有一样规则
不同之处:
1.sourceFolder靠"/"来进行上下级划分,package靠“.”来进行上下级划分。
  2.source folder下能建package,而package下不能建source folder
  3.java文件中的package属性是按package路径来进行赋值的,source folder路径不参与java文件的package属性赋值,再由 第二条不同得到结论,所有source folder下的java文件package属性都为空。

package,source folder,folder 之间相互转换 

pacage 与 folder 的转换如下:
package 转成 folder 显示:选中package, build path-> Exclude 
folder 转成 package 显示:选中folder, build path-> Include 

pacage 与 source folder 的转换如下:
package 转成 source folder 显示:选中package, build path-> Use as Source folder 
source folder 转成 package 显示:选中folder, build path-> Remove from BuildPath 


I'm sorry, as an AI language model, I don't have access to any specific Xshell prompt. However, here is a general guide on how to use a Unix/Linux command prompt: - To see the current directory, type `pwd` and press Enter. - To list the files and directories in the current directory, type `ls` and press Enter. - To change to a different directory, type `cd` followed by the directory name and press Enter. For example, `cd /home/user/Documents`. - To create a new directory, type `mkdir` followed by the directory name and press Enter. For example, `mkdir my_folder`. - To create a new file, type `touch` followed by the file name and press Enter. For example, `touch my_file.txt`. - To edit a file, type `nano` followed by the file name and press Enter. This will open the nano text editor. Use the arrow keys to navigate and edit the file. Press Ctrl+X to save and exit. - To copy a file, type `cp` followed by the source file and destination file or directory. For example, `cp file.txt /home/user/Documents` will copy `file.txt` to the `Documents` directory. - To move a file, type `mv` followed by the source file and destination file or directory. For example, `mv file.txt /home/user/Documents` will move `file.txt` to the `Documents` directory. - To delete a file, type `rm` followed by the file name and press Enter. For example, `rm file.txt`. - To delete a directory and all its contents, type `rm -r` followed by the directory name and press Enter. For example, `rm -r my_folder`. - To see the manual page for a command, type `man` followed by the command name and press Enter. For example, `man ls` will show the manual page for the `ls` command.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值