CLion and Intellij in the same project


Is there a way to run both CLion and Intellij on the same project?  I have a project that has a mix of C++ and Java code.  However, if I try to open both IDEs on the same project I get errors reported by the IDE and lots o annoying notifications to reload project.  Generally on reload much of the project structure gets lost.  It appears that CLion and Intellij stomp over each other's project settings.



Hi Michael.

Yes, there are some problems with simultaneous usage of CLion and IntelliJ IDEA.

We are going to provide CLion functionality as a plugin to IntelliJ IDEA in the future, but not in the nearest future.
Feel free to commant or upote a feature reuqest in the tracker:
There are some difficult points for the integration CLion as a plugin to IntelliJ IDEA and we need to fully analyse what we can do to solve them.
We appreciate your patience!

What about compiling CLion to use ".clion" as a project directory instead of ",idea"? Wouldn't it solve the problem once and for all?


I need similar functionality for other JetBrains IDEs. I've tried to use AppCode alongside PyCharm, but the IDEs seem to clash over the same ".dea" directory. @Nil has a very good point about different project directory names across your IDEs. 


I've been struggling with this also. Saying IDEA will have a CLion plugin "one day" really doesn't help me today. Been waiting for that train since about 2004. I can see how Nil's suggestion may break your future plans for integration of the two IDEs but surely a patch to CLion to make the project directory name optionally configurable (with .idea the default) is quick to implement and won't break your future. At least this would allow me today to get back to building my app instead of hacking around not being able to have C++ and Java in the same git repo.


I have discovered a workaround that will probably suffice for my specific case (both C++ and Java versions of components within a single project) until this is properly fixed.

I had an existing IntelliJ multi-module Java project to which I wanted to add C++ components (lets call it <existing>).

I created a new CLion project (lets call it <temp>) with the same name as <existing>, but outside <existing>'s source tree. I then created a .clion directory within the root of <existing> (along side .idea).

I then moved the entire <temp>/.idea directory into <existing>/.clion (so I now have <existing>/.clion/.idea).

I then edited <existing>/.clion/.idea/misc.xml changing the project dir to reference $PROJECT_DIR$/.. .

<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/.." />

I think this can also be done by opening the CLion project (you have to open it as a new project as it has moved) and selecting Tools -> CMake -> Change Project Root.

If you are on a Mac and can't find <existing>/.clion when opening the project anew use:




I should have a PR for a patch implementing my earlier suggestion (against the IntelliJ Community JPS package) soon.