Is there any way to skip some Java files when compiling under Eclipse?
在Eclipse下编译时有没有办法跳过一些Java文件?
5 个解决方案
#1
35
Remove the class from the build path. You can do this for a single file or group of files by selecting them in the Project Explorer, then right click → Build Path → Exclude.
从构建路径中删除该类。您可以通过在Project Explorer中选择它们来为单个文件或一组文件执行此操作,然后右键单击→构建路径→排除。
#2
4
You can always exclude the item from being built. Right click on the file and go to build-path. Then click exclude.
您始终可以排除正在构建的项目。右键单击该文件,然后转到build-path。然后单击排除。
#3
1
Delete (or move) them. It can't compile what isn't there ;)
删除(或移动)它们。它无法编译不存在的东西;)
Note: Other forms of removing the content you don't want compiled also work.
注意:删除您不想编译的内容的其他形式也可以。
#4
1
This page should help you. If you wish to remove a file from compilation you can delete it, as cdeszaq suggested, or you can change the extension of it(For example if you have test.txt changing it to test.txtz would pretty much make it un-openable)
这个页面可以帮到你。如果您希望从编译中删除文件,您可以删除它,如cdeszaq建议的那样,或者您可以更改它的扩展名(例如,如果您将test.txt更改为test.txtz将使其无法打开)
#5
0
There's another way to do it. I discovered it by first using the Build Path -> Exclude option in other answers, as Eclipse said something about configuring filters.
还有另一种方法可以做到这一点。我首先在其他答案中使用Build Path - > Exclude选项发现了它,因为Eclipse提到了有关配置过滤器的内容。
Right click the project -> click Properties -> click Java Build Path -> click Source tab -> select ProjectName/src -> click Edit... (or double click Excluded) -> add an Exclusion pattern like com/blah/blah/blah/, potentially with wildcards.
右键单击项目 - >单击属性 - >单击Java构建路径 - >单击源选项卡 - >选择ProjectName / src - >单击编辑...(或双击排除) - >添加排除模式,如com / blah / blah / blah /,可能带有通配符。
It looks like the wildcards are your standard * and ?, but they also have **, which appears to be for wildcarding any number of folders, which must imply that * and ? are for only wildcarding a single file/folder name.
看起来通配符是你的标准*和?,但它们也有**,它似乎用于通配任意数量的文件夹,这必须暗示*和?仅用于通配单个文件/文件夹名称。
#1
35
Remove the class from the build path. You can do this for a single file or group of files by selecting them in the Project Explorer, then right click → Build Path → Exclude.
从构建路径中删除该类。您可以通过在Project Explorer中选择它们来为单个文件或一组文件执行此操作,然后右键单击→构建路径→排除。
#2
4
You can always exclude the item from being built. Right click on the file and go to build-path. Then click exclude.
您始终可以排除正在构建的项目。右键单击该文件,然后转到build-path。然后单击排除。
#3
1
Delete (or move) them. It can't compile what isn't there ;)
删除(或移动)它们。它无法编译不存在的东西;)
Note: Other forms of removing the content you don't want compiled also work.
注意:删除您不想编译的内容的其他形式也可以。
#4
1
This page should help you. If you wish to remove a file from compilation you can delete it, as cdeszaq suggested, or you can change the extension of it(For example if you have test.txt changing it to test.txtz would pretty much make it un-openable)
这个页面可以帮到你。如果您希望从编译中删除文件,您可以删除它,如cdeszaq建议的那样,或者您可以更改它的扩展名(例如,如果您将test.txt更改为test.txtz将使其无法打开)
#5
0
There's another way to do it. I discovered it by first using the Build Path -> Exclude option in other answers, as Eclipse said something about configuring filters.
还有另一种方法可以做到这一点。我首先在其他答案中使用Build Path - > Exclude选项发现了它,因为Eclipse提到了有关配置过滤器的内容。
Right click the project -> click Properties -> click Java Build Path -> click Source tab -> select ProjectName/src -> click Edit... (or double click Excluded) -> add an Exclusion pattern like com/blah/blah/blah/, potentially with wildcards.
右键单击项目 - >单击属性 - >单击Java构建路径 - >单击源选项卡 - >选择ProjectName / src - >单击编辑...(或双击排除) - >添加排除模式,如com / blah / blah / blah /,可能带有通配符。
It looks like the wildcards are your standard * and ?, but they also have **, which appears to be for wildcarding any number of folders, which must imply that * and ? are for only wildcarding a single file/folder name.
看起来通配符是你的标准*和?,但它们也有**,它似乎用于通配任意数量的文件夹,这必须暗示*和?仅用于通配单个文件/文件夹名称。