是否可以在 Eclipse 中同时使用 CDT 和 Java IDE?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2642069/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 10:15:16  来源:igfitidea点击:

Is it possible to have CDT and Java IDE together in Eclipse?

javaeclipseeclipse-cdteclipse-jdt

提问by hhafez

I have an Eclipse CDT environment up and running and customised just the way I like it. I'm also going to be heavily dealing with Java.

我有一个 Eclipse CDT 环境启动并运行,并按照我喜欢的方式进行了自定义。我还将大量处理 Java。

I don't want to install a separate version of Eclipse just to get the Java features, as I'll be switching between C -> C++ -> ADA -> Java quite often. Because of this I'd like the one IDE to support all the languages.

我不想安装单独版本的 Eclipse 只是为了获得 Java 功能,因为我会经常在 C -> C++ -> ADA -> Java 之间切换。因此,我希望一个 IDE 支持所有语言。

At the moment I've got C/C++ and Ada working together (CDT + GNAT workbench).

目前我已经让 C/C++ 和 Ada 一起工作(CDT + GNAT 工作台)。

How can I get the Eclipse Java support installed with out installing Eclipse from scratch again?

如何在不重新从头安装 Eclipse 的情况下安装 Eclipse Java 支持?

采纳答案by Newtopian

I've had both installed together without problems. In fact I had the JDT, CDT, PyDev all working side by side sometimes I even had projects containing code from all three languages and it all worked just dandy. All the bits that were supposed to be ready for the others were provided you order your builders correctly. (I had an API implemented in C++ with support for Java, Python and C++ all in the same project).

我已经安装在一起没有问题。事实上,我让 JDT、CDT、PyDev 一起工作,有时我什至有包含所有三种语言代码的项目,而且一切都很好。如果您正确订购了构建器,则应该为其他人准备好所有位。(我有一个用 C++ 实现的 API,在同一个项目中支持 Java、Python 和 C++)。

However since you already have your set-up running just the way you want I would strongly recommend that you would backup your installation of Eclipse AND your .metadata folder in your workspace (I usually just zip the whole workspace when I tinker with Eclipse like that)

但是,由于您的设置已经按照您想要的方式运行,我强烈建议您备份 Eclipse 的安装和工作区中的 .metadata 文件夹(当我像那样修补 Eclipse 时,我通常只是压缩整个工作区)

Then you can just get in your plugin manager and get the JDT plugin to install itself from the update site. Frankly I do not anticipate that you will get any problems. You can use different workspaces to separate CDT and Java but unless you really need this clear separation I would recommend that you do everything under the same workspace. Switching workspace in Eclipse pretty much means you have to launch a new instance of it with all the loading and waiting this implies.

然后你就可以进入你的插件管理器并从更新站点获取 JDT 插件来安装它自己。坦率地说,我不认为你会遇到任何问题。您可以使用不同的工作区来分离 CDT 和 Java,但除非您确实需要这种清晰的分离,否则我建议您在同一工作区下进行所有操作。在 Eclipse 中切换工作区几乎意味着您必须启动它的一个新实例,并进行所有加载和等待,这意味着。

Mixing language types in the same project might require that you tinker with the eclipse project files manually. Sometimes the gui will not offer you to have multiple aspects for the same projects. Otherwise switching from one language to the other is transparent. You can switch perspective or you can build your own perspective with just the views you want. Again there was no problem mix-matching views from CDT with views from other languages/plugins.

在同一项目中混合语言类型可能需要您手动修改 eclipse 项目文件。有时 gui 不会为您提供相同项目的多个方面。否则从一种语言切换到另一种语言是透明的。您可以切换视角,也可以仅使用所需的视图构建自己的视角。同样,将来自 CDT 的视图与来自其他语言/插件的视图混合匹配也没有问题。

This is probably the biggest strength of Eclipse, Provide a unified development environment regardless of the work you are doing. This being said, not all language are supported equally, good news for you is that the Java plugin is a lot more rich and mature than the CDT.

这大概就是 Eclipse 最大的优势了,提供一个统一的开发环境,不管你在做什么工作。话虽如此,并非所有语言都得到同等支持,对您来说好消息是 Java 插件比 CDT 更丰富和成熟。