Importing Eclipse projects

Hello,

I am working with a team who uses Eclipse and i recently switched to IntelliJ.
Until now i always used the import Eclipse projects functionality which worked pretty well, but now this option seems to have disappeared.

When i do File -> Import Module, and that i select the path to an Eclipse directory (containing .classpath and .project files), the only choices i get in the external model options are "Gradle" and "Maven" (i followed the procedure from http://www.jetbrains.com/idea/webhelp/importing-eclipse-projects-into-intellij-idea.html, but that's how i always did it).
I'm pretty sure i was able to select Eclipse from here and then to link the module files to eclipse classpath, but now i can not do it anymore.

This happened after i killed IntelliJ because it was processing something using full CPU which took way too much time, and half of my modules disappeared from the project list. So now i can only work on a few projects with IntelliJ and i have to use Eclipse for the rest of them.

Do you have any ideas how i can fix this? I really would like to not have to use Eclipse anymore, IntelliJ is so much better.

Thank you!

8 comments

Hello.

The first thing to check: make sure Eclipse integration plugin is enabled in Settings / Plugins.

Regards,
Alexander.

0

Wow thanks a lot Alexander!! I didn't know that this was a plugin that handled Eclipse integration. I'm wondering how this got disabled.

Anyway, everything is working fine now, going back to work with IntelliJ \o/

0

Sorry to revive an old thread, but I am also trying out IntelliJ with Eclipse.

I have a functional eclipse project (.classpath, .project, .settings, etc). I was happy to see IntelliJ offer to import this as an Eclipse project, but that changed to disappointment pretty quickly.

I use Gradle (complicated setup, so I'm not importing as a Gradle project) to create my .classpath and .project files. But IntelliJ seems to have completely ignored them. Instead it imported a) build directories as sources, and b) libraries not intended to be on my classpath.

Is there some way to tell IntelliJ to *only* use the classpath defined in the .classpath file and no other? Our current toolchain (which assumes eclipse) depends on this.

0

What actions do you perform to open Eclipse project? For example, did you try the main menu / File / New / Project from Existent Sources?

0

Yes, I did exactly that.

The first thing it does it find all my sources, which is fine.

Next, it finds all my libraries, which includes many libraries that are present in the directory hierarchy, but were not included in the Ecilpse .classpath file because I don't want them on my classpath. Now I have to remove them.

Next, it looks for modules, which finds numerous "build" folders with .class files that were built from the commandline that, again, I don't want in my project and were not included in my .classpath file.

0

"Project from Existent Sources" action opens the file chooser to select a root directory. On selecting a directory appears the wizard. On the first page there are options "Create project from existing sources" (default), and another one: "Import project from external model", with sub-choices like Eclipse, Maven, etc.

From your story I have a feeling that you have kept "Create project from existing sources" selected, and did not select Eclipse. Is that true?

0

1. File -> New -> Project from Existing Sources...

2. selected my Eclipse project directory (not the workspace)

3. ah, I see the problem

The funky UI choices in IntelliJ made it not obvious to me which option was chosen and I thought the selected item ("Eclipse project") in the scrolling list was the current item. In fact, it was set to create from existing sources.

You are correct; I mis-read the funky UI.

0

But, now I see I have a different problem.

My Eclipse project (actually a combination of Gradle projects and submodules) has what IntelliJ sees as duplicate names. For example (looking at the Import Project dialog presented after I properly selected the "Import project from external model" dialog):

- PROJ1

- services (PROJ1/services)

- PROJ2

- services (PROJ2/services)

- sri-services (PROJ3/sri/services)

etc.

 

As you can see, I have several subdirectories named "services" in my submodules. But IntelliJ wants to strip off the parent directory (PROJ1, PROJ2) and use only the child name. Curiously, it is ok if there is another level of subdirectory in there (PROJ3/sri/services is imported as "sri-services").

I'll try skipping these directories and manually adding them back (hope I can rename them within the project without affecting the name on disk).

0

Please sign in to leave a comment.