简体   繁体   中英

Eclipse: Remove Eclipse generated .class and .project files

I have a Java project with SVN version control system. My IDE is eclipse. Iniitally when I open the project, I edited something. Since this is team project. Someone else commit his own .class and .project file into svn. When I pointed out, he removed .class and .project in some particular sub projects. Anyway, I have .class and .project in all sub projects. Now I want to a clean environment, I want to delete all .class and .project files. Are there some script available in this forum?

您没有提到正在使用什么操作系统...如果是Linux,则可以在命令行中执行以下操作:

find /the/path/to/your/project -name ".class" -exec rm {} \;

If you have a unix like environment then 'find' from a command line could do it. First cd to the project directory then find . ( -name *.class -or -name .project ) -delete

Are you using Maven as a build tool? What is your directory structure.

Any bin, out, target etc. directories should be on ignore list in SVN. You can use "add to ignore list" in Tortoise SVN or edit folder properties and set "svn:ignore" property. This you can do recursively. Mind that this will affect other developers too.

If you're not using Maven, deleting .project and .classpath might cause some trouble. There might be some project-specific settings set. Blindly deleting .project files is not a solution. If you use Maven, you can definetely delete .project, .classpath and .settings, add them to ignore list and re-import all proejects with m2e plugin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM