Search code examples
javaeclipseeclipse-cdteclipse-jdt

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


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.

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.

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

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


Solution

  • 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).

    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)

    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.

    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.

    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.