如何使用 Eclipse 比较两个文件?Eclipse 是否提供了任何选项?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4623564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I compare two files using Eclipse? Is there any option provided by Eclipse?
提问by Rinkal Bhanderi
回答by Vikas Patidar
To compare two files in Eclipse, first select them in the Project Explorer / Package Explorer / Navigatorwith control-click. Now right-click on one of the files, and the following context menu will appear. Select Compare With / Each Other.
要在 Eclipse 中比较两个文件,首先在Project Explorer/Package Explorer/Navigator 中通过按住 Control 单击选择它们。现在右键单击其中一个文件,将出现以下上下文菜单。选择相互比较。
回答by Doon
Just select all of the files you want to compare, then open the context menu (Right-Click on the file) and choose Compare With, Then select each other..
只需选择要比较的所有文件,然后打开上下文菜单(右键单击文件)并选择比较,然后相互选择..
回答by bmaupin
If one or both of the files you wish to compare isn't in an Eclipse project:
如果您要比较的一个或两个文件不在 Eclipse 项目中:
Open the Quick Access search box
- Linux/Windows: Ctrl+3
- Mac: ?+3
Type compareand select Compare With Other Resource
Select the files to compare → OK
打开快速访问搜索框
- Linux/Windows:Ctrl+3
- 麦克:?+3
键入比较并选择与其他资源比较
选择要比较的文件 → OK
You can also create a keyboard shortcut for Compare With Other Resourceby going to Window→ Preferences→ General→ Keys
您还可以通过转到“窗口”→ “首选项”→“常规”→“键”来创建与其他资源比较的键盘快捷键
回答by armyofda12mnkeys
Other than using the Navigator/Proj Explorer and choosing files and doing 'Compare With'->'Each other'... I prefer opening both files in Eclipse and using 'Compare With'->'Opened Editor'->(pick the opened tab)... You can get this feature via the AnyEdit eclipse plugin located here (you can use Install Software via Eclipse->Help->Install New Software screen): http://andrei.gmxhome.de/eclipse/
除了使用 Navigator/Proj Explorer 并选择文件并执行“Compare With”->“Eachother”...我更喜欢在 Eclipse 中打开这两个文件并使用“Compare With”->“Opened Editor”->打开的选项卡)...您可以通过位于此处的 AnyEdit eclipse 插件获得此功能(您可以通过 Eclipse->Help->Install New Software 屏幕使用安装软件):http: //andrei.gmxhome.de/eclipse/
回答by andrew pate
If your compairing javascript you might find it not displaying.
如果您比较 javascript,您可能会发现它没有显示。
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509820
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509820
Here is a workround...
这是一个解决方法......
- Window > Preferences > Compare/Patch > General Tab
- Deselect checkbox next to "Open structure compare automatically"
- 窗口 > 首选项 > 比较/修补 > 常规选项卡
- 取消选中“自动打开结构比较”旁边的复选框