Import Eclipse project into IntelliJ while keeping them synced - java

I'm trying to import Eclipse Project to IntelliJ while keeping them synced, because I want to use IntelliJ as an IDE but keep Eclipse project in the way it is now and if it anything, directly upload my programming assignments (as an Eclipse project). In other words, I want to edit Eclipse project with IntelliJ IDE, that's all.
After some searching, I discovered that you can do that in IntelliJ Like that:
Import project -> [Choose .project File] -> Keep project and module files in [some other directory] & Link created IntelliJ IDEA modules to Eclipse project files -> [Select project to import, "Empty Karel Project" in my case]
However, no .java files in my project whatsoever. That's where I need help. Am I missing or misinterpreting something? By the way, Eclipse Integration plugin is enabled.
Project files after importing:

IntelliJ IDEA allows you to import projects from Eclipse in two ways. If you do not need backwards compatibility, you typically instruct IntelliJ IDEA to create a new set of native project files. Otherwise, you can instruct IntelliJ IDEA to keep project files in sync so that you can work on the project from both environments.
Click Import Projectfrom the Quick Start window or select the File → Import Project ...menu item. Next, select the .classpath file or .project file to import and confirm.
And for other ways you can refer below link
https://confluence.jetbrains.com/pages/viewpage.action?pageId=59944389

Related

How do I import gradle projects with with EGit in Eclipse? (libGDX)

I am quiet new to git but for now I have set up a repository on Bitbucket. The repository contains my libGdx Project which is gradle project containing 3 sub-projects (Android, Desktop and Core).
So now it is my aim to clone this to eclipse using EGit. Everything works until i have to choose a wizard for the Import of the projects.
After i added the repo i use Import > git to Import a Project from the added repository
Here i have to choose the wizard
If i choose "Import existing Projects" the program tells me that no Projects are found.
After that i tried the "Use the New Project wizard" but it confuses me and actually i want to Import a gradle Project and not create a new one.
The last Option "Import as General Project" gives me just Folders and files, so eclipse doesn't notice the existing Projects. Like i said i'm quiet new to git so i appreciate every help ! :)
Thanks :)
The wizard intends to create the project settings files for Eclipse (.project and .settings/).
It seens like you don't have them in your git repository (I don't think you should). That why Eclipse asks you to create a new "project".
the best way is "Import -> Gradle project" (you need to have gradle plugin installed in eclipse first)
But is you don't want to use gradle plugin you need first to generate eclipse file. To do so, type "gradle eclipse" in your working directory (see https://docs.gradle.org/current/userguide/eclipse_plugin.html) and then import existing project into your eclipse workspace.
Another thing, it seems that your workspace is in the same folder as sources (.metadata folder), you should create your eclipse workspace in another directory.

Import Java project from GitHub to Eclipse

I'm trying to import a project on GitHub into eclipse because there are a few things I want to add to it. However whenever I add it I get a ton of errors and problems with it...
The GitHub project is https://github.com/dmulloy2/SwornGuns
I've tried adding it to eclipse and it didn't work. I then tried making a project in eclipse and then put the files in, that didn't work. I also read online that going to Configure -> Convert to Maven Project would work, and then importing the spigot.jar file that this source depends on. However that didn't work and just gives me a ton of import errors.
The errors I am getting:
That project is a maven project. A simple way is clone that project into your machine, and import it as a maven project, with File - Import - Maven - Existing Maven Project.
Eclipse will help you resolve the pom file and configure project and download necessary libs.
First, make sure you are using Luna, the most recent version.
In eclipse, File > Import > Git > Projects from Git > Existing Local Repository.
In the Import Projects from Git screen, click add, then goto the location of the cloned repository. Click open, finish, then next. Select Java > Java Project, and click next again.
At this point, there are three options.
Import existing projects
Use the New Project Wizard
Import as General Project
Pick "Use the New Project Wizard". Then, uncheck "Use Default location", and click browse. Select a folder (You probably want the location you cloned the repo to), click "Open", and give the Project a name. Click next, and make sure that the src/bin folders are setup correctly, and click finish.
Whew!
Of course, the Import from Git option was only added in Luna, so update eclipse if necessary.

Importing GWT project to IntelliJ fails

I have a GWT project, which builds under Eclipse, but I am trying to migrate it to IntelliJ.
I appear to have imported it correctly, downloaded all the required libraries using maven / pom.xml, but when I try to make the project, I get the following error:
java: package com.infoshare.clearcore.shared.model does not exist
If I browse the sources, it is there, but using any of the IDE "goto" options fail.
The picture below shows the project structure, which has two modules one with the failing (auto generated) source code, and the other with the "com.infoshare.clearcore.shared.model" code. Is there some way I can tell the compile to look in both modules, or do I have to restructure the code?
How did you import the project? The best way I found to import Maven projects is simply to open the root pom.xml using File > Open, then IntelliJ will detect the project and import it automatically.
Eveything should be configured properly. in particular, the target folder should be displayed in another color, because the IDE knows it contains generated files (which is not the case in your current screenshot).

Importing a Java project to IntelliJ IDEA community edition

I'm new to IntelliJ. What is the best (and recommend method) for importing project into IntelliJ. Is there a maven plugin for doing this?
More specially I'm interesting in importing this project.
https://github.com/nathanmarz/storm-starter?source=c
Thanks.
UPDATE 1 - When I try to use File -> open (the m2-pom.xml file) it just opens the xml file (as shown in the screenshot below.
It looks like that project has a pom file named m2-pom.xml. You should import that as a maven project. Assuming it's using standard repositories, you'll immediately be able to compile the code with maven.
You can select Open in the menu, and then choose that file and it should load the project.
Be aware this seems to be a clojure project. You might want to research the La Clojure plugin to see how/if it can import clojure projects with it. It looks like the steps I gave will work, but the code may not run very easily for you without the La Clojure plugin.
You could either import the Maven project inside of IntelliJ (File -> Import Project...), or you could simply use the Maven IDEA plugin. All you do is execute mvn idea:idea inside of the Maven directory, and a project file will be generated. This file may be opened as a project inside of IntelliJ.
EDIT: #maba warns not to use the Maven IntelliJ plugin.

Import IntelliJ module into Eclipse project through SVN

I am working with Eclipse, while another developer in our company has developed a large project using IntelliJ. He has used the export to eclipse feature in IntelliJ, and I checked it in through SVN.
But this doesn't seem to do the job. The entire directory structure is still IntelliJ's, and the Eclipse project doesn't recognize the JRE (which I added to the build path) or the jars I added, and not even the packages themselves -- which, as I mentioned, are located within IntelliJa's structure (src > main > java > com.package_name).
Looking everywhere it seems that everyone is going in the other direction: from Eclipse to IntelliJ.
So my question is, is it at all possible to import successfully an IntelliJ project to Eclipse, while maintaining the directory structure so that SVN will still work?

Categories