eclipse存储什么文件将Java代码样式设置存储到? [英] What file(s) does eclipse store Java code style settings to?

查看:109
本文介绍了eclipse存储什么文件将Java代码样式设置存储到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了相当多的时间修改我的Java代码样式设置成为我喜欢的方式。



例如,转到 Windows - >偏好 - > Java - >代码样式 - >清理/格式化/代码模板

我已经设置eclipse以使用空格而不是制表符,自定义java文件顶部的标题的其他东西。



现在我在另一台电脑上工作,不得不安装一个新的Eclipse Helios副本。

有没有文件或者我可以重用的文件集,所以我不必每次都继续设置这个?

解决方案

如果您没有设置项目特定设置,则在

  workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs 

如果您有项目特定设置,则位于 .settings 您的项目目录。

 < profile kind\ =CleanUpProfilename\ = t1version\ =2> 
< setting id\ =cleanup.remove_unused_private_fieldsvalue\ =true/>
< setting id\ =cleanup.always_use_parentheses_in_expressionsvalue\ =false/>
...

后一个选项(项目特定设置)使您更容易在您的源代码控制工具中进行版本化,作为其他项目文件的一部分,您可以在其他地方的项目中检查新版本的项目时返回。



请参阅您是否将项目文件保留在版本控制?更多。


I spent quite a bit of time modifying my Java code style settings to be the way I like.

For example, go to Windows -> Preferences -> Java -> Code Style -> Clean Up / Formatter / Code Templates.
I've set eclipse to use white space instead of tab chars, customized the heading on the top of java files, and a whole bunch of other stuff.

Now I'm working on a different computer and had to install a new copy of Eclipse Helios.
Is there a file or set of files I can reuse so I don't have to keep setting this up everytime?

解决方案

If you haven't set "project specific settings", it is in

workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs

If you have "project specific settings", it is in the ".settings" directory of your project.

<profile kind\="CleanUpProfile" name\="t1" version\="2">
  <setting id\="cleanup.remove_unused_private_fields" value\="true"/>
  <setting id\="cleanup.always_use_parentheses_in_expressions" value\="false"/>
  ...

That latter option (project specific settings) makes it easier for you to version it in your source control tool, as part of the other project files you would want to get back when doing a checkout of a new version of your project somewhere else.

See "Do you keep your project files under version control?" for more.

这篇关于eclipse存储什么文件将Java代码样式设置存储到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆