Import multiple projects in IntelliJ IDEA - eclipse

I have a number of projects in my Eclipse workspace, some of them plain ol' Java projects, some of them Java web applications, some of them Flash Builder Flex projects.
They all live in a directory hierarchy. How can I open all of them in IntelliJ IDEA to be able to migrate from Eclipse to IDEA? The projects reference each other.

You can create an IntellIJ IDEA Project from source using the Import Project in the main menu.
Select the eclipse .project file or .classpath then check Link created IntelliJ IDEA modules to Eclipse project files.
The official docs, here:
To import an existing Eclipse projects to IntelliJ IDEA:
Open the New
Project Wizard. Having selected the option Import project from
external model, click Next.
On the Import page of the New Project
Wizard, select Eclipse. Optionally, check the option Import into
current project. Click Next.
On the next page of the wizard, specify
the directory, that contains the desired Eclipse workspace. In the
section IntelliJ IDEA project and module file location, specify
whether you want to create IntelliJ IDEA module files in the same
directory where the Eclipse projects reside, or in a dedicated
directory of your choice.
Check the option Link created IntelliJ IDEA
modules to Eclipse project files to automatically synchronize the
Eclipse projects and IntelliJ IDEA modules.
Specify whether you want test sources to be imported.
Click Next. IntelliJ IDEA scans the specified workspace for projects.
On the next page of the wizard, select the Eclipse projects you want
to import. So doing, each Eclipse project is converted to a separate
IntelliJ IDEA module. Click Next. Specify the name for the new
IntelliJ IDEA project, and the location of the project files.
Select also the format in which the project will be stored. Click Finish.
If you select "Keep project and modules in" you could separate eclipse project and IntelliJ IDEA project files
I never did something like this, but after reading docs and playing a bit the options it should be the best way.

Related

Creating new project in Eclipse from Github parent/child pom?

What's the correct way to create a project in Eclipse from a github project which uses the parent/child pom construct, for example https://github.com/vladmihalcea/vladmihalcea.wordpress.com ?
I can clone/download it ok, but then do I need to manually create an eclipse project for each sub-project within or is there a better way?
(Googled the hell of out this question without finding an answer, but please feel free to post a link if you know of such.)
Use the Import feature of Eclipse.
Select File / Import ... from the Eclipse menu.
From the Import dialog window, Select the Maven / Existing Maven Projects wizard option.
Click Next.
From the Import Maven Projects dialog, choose the root directory using the Browse directory chooser.
With the directory choosen, the dialog will be populated with all available Maven projects. Check all the projects to be imported.
Click Finish.

Maven multimodule projects linking in eclipse

I have a maven multi module project which has 5 modules. Some of my modules depend on one or more other modules, I am successfully able build the project and in eclipse also I am not getting any errors. However there is one problem which is bothering me, when i ctrl + click in my code and the class is defined on some other project eclipse does not open the file in the editor. I know i can attach the source code using maven but still i wont be able to make changes to that file.
Is there any way to be able to link projects in eclipse through maven?
Is there any way to be able to link projects in eclipse through maven?
That behaviour is the default. To check if for some reason that default is not in effect for your project, right click your project (the project you want to jump from) and go to "Maven". If there is an option "Disable Workspace Resolution" the workspace resolution is switched on, meaning you can theoretically jump from that project.
If you still cannot jump, then the project you want to jump to is not in your workspace. Take into account that for eclipse to identfy one project as dependency of another, everything including version must match.
Also check what rest_day said. You must have the projects importet as maven projects, but running eclipse:eclipse is not required anymore with current (up to ca 2 year old) eclipse.
Did you import the projects as Maven projects?
Also, could you go to the root of the project and run mvn eclipse:eclipse
eclipse:eclipse
Full name:
org.apache.maven.plugins:maven-eclipse-plugin:2.10:eclipse
Description:
Generates the following eclipse configuration files:
.project and .classpath files
.setting/org.eclipse.jdt.core.prefs with project specific compiler settings various configuration files for WTP (Web Tools Project), if the parameter wtpversion is set to a valid version (WTP configuration is not generated by default)
If this goal is run on
a multiproject root, dependencies between modules will be configured
as direct project dependencies in Eclipse (unless useProjectReferences
is set to false).
Instead of Ctrl+Click, click on the identifier and press F3. If you now see a red text reading "Current text selection cannot be opened in an editor", you've been hit by this bug.
See this question for a solution: How do I get rid of "Current text selection cannot be opened in an editor" in Eclipse?

How to use SVN to build a library

I am trying to follow a tutorial, and I am told to:
1- Get the source code for the Java EMV Reader library from http://code.google.com/p/javaemvreader/ and build it.
2- Drop the resulting jar file in lib/.
3- Import the project in Eclipse and build it.
I right click the java files, and choose run as but don't get an option to run as Java Application. I also can not export the files as a JAR file. I have enclosed an image of what I have
After the first comment, I right clicked on my project, and under Maven, chose the option "configure as Maven" project. ( Thank you so much; this must be one of the fastest resolutions in the world )And I can now run the project. I get the window in my pic2, which I have attached. I don't however know what step 2 of the above instructions means. I don't see a lib/ folder. And the project he is refering to in step 3 is on git. Any ideas on what he means? ![pic2]!1
Eclipse projects have a "type" and that controls what tools are available. You probably created a "Basic Project" which means there are no compilers or other Java tools associated with it. You would want to create a Java Project in Eclipse.
That project does not seem to have Eclipse .project and .classpath files checked into the repository. It does look to be a Maven project however. So you would either want the m2eclipse plugins installed, and check this out as a Maven project, which would handle configuring everything else, or you want to use the Checkout As ... option and use the wizard to create a new Java project to checkout.
These are more Eclipse IDE questions than SVN or Subclipse questions.

Importing maven sourceproject into eclipse

I have imported my maven project in eclipse using Import Maven project. It got import in eclipse project explorer, but all the source folder are opening as files and folders, its not opening as java source folder. Since its opening as files and folder, it doesnot have compilation unit, found very difficult to code using it.
What do I need to do inorder to make the source folder as java source folder so that I can code easily?
Select the project and from the context menu choose Maven -> Update Project Configuration (This menu item gets reworded across various maven releases so look for something similar). You may also need to choose Update Dependencies.
In the shell/command line, execute mvn eclipse:eclipse

How to convert IntelliJ project to Eclipse?

I have one IntelliJ project and I want to open it in Eclipse, so what should I do?
There is an export to eclipse option in Intellij Under file menu.
This option will generate you the necessary .project and .classpath files that will be used by eclipse. Personally, I would remove any IDE dependencies using some dependency management systems like Maven or Apache IVY. ( Is system the right term?)
I had the same issue and (I don't have Intellij) but doc_180's comment pointed me in the right direction. Here is a simple solution. In Eclipse create a new blank Android project. Copy the .project and .classpath files and the .settings folder to the Intellij folder. Edit the .project file and change the name of the project.
You should now be able to Import the project in Eclipse by right clicking and selecting "Import->Existing Project into Workspace".
I see this is an old question, but thought I should add this answer for others Googling it like me ;)
Without access to IntelliJ to export and convert the project, try the following.
In STS or Eclipse create an empty project first, then, select File -> Import and choose General -> File System. In the resulting dialog box, select the root folder of the IntelliJ project as source and the empty project as the destination.
For unit tests, add the test folder as a source folder to the build path (right-click on the folder, select Build Path -> Use as Source Folder).
The projects I import this way run without any further modifications, including the tests.
Eclipse and Intellij create different project structure each other (Output path, Source Code etc...). You can export the current project to Eclipse environment.
File -> Export -> Project to Eclipse