0

I am trying to clone this project and import it into Eclipse.

It was initially made in Intellij.

This is what I see after the project into Eclipse enter image description here

I'am trying to run the program and get a simple output of "Hello"

However when I right click the project and set up a new run configuration for a Java application, the project doesn't even show up when I try to browse for it. Even when I type the name of the project, Eclipse tells me it can't find the project even through it's in my workplace.(shown below) enter image description here

Does anyone know what the issue is? I tried making a new Java Project, copying over the files Stoking didn't have(.settings, .project, etc) but that didn't work. I also tried looking at these two links - link 1 and link 2 but the original project isn't a Maven project.

Community
  • 1
  • 1
committedandroider
  • 8,711
  • 14
  • 71
  • 126

2 Answers2

1

I can see from your screenshot, that the project does not have the Java facet (the icon doesn't have a J).

1. get the code

Go into your eclipse workspace and type:

git clone https://github.com/ssharif6/StocKing.git

2. Open in Eclipse

Then, in Eclipse choose File -> new -> Java Project and enter StocKing for the Project Name field. It will create the project using the files already present in the StocKing folder.

alexbt
  • 16,415
  • 6
  • 78
  • 87
  • Thank you so much. So what this did was basically turn a project in a folder to a Java project? – committedandroider Jan 15 '17 at 01:07
  • I can see from your screenshot, that the project does not have the Java facets (the icon doesn't have a J). Your project wasn't imported as a Java project – alexbt Jan 15 '17 at 01:07
0

Importing an IntelliJ Project into Eclipse will not work, because Eclipse can't understand the IntelliJ configuration/settings.

Therefore you need to just download it into your working directory and then create a new Project with the exact name of the Folder. Eclipse will then see that there are already files and will pre-populate a few fields for you. File -> new -> Java Project and then use "StocKing" as the name. And then make sure that on the next screen the sourcefolders are correctly matched to what your projects file struckture looks like. (In your case the defaults should be fine)

But if you try to trick eclipse by adding empty eclipse project config files, it will break.

You can get around those issues by using maven (for example). That way the configuration would be stored in a external maven file that can be understood by eclipse AND IntelliJ (and most other IDEs)

Timmeey
  • 363
  • 3
  • 9
  • The config files I added weren't empty though. They were the same ones created when you create a new Java project – committedandroider Jan 15 '17 at 02:03
  • I don't know about the internals of the eclipse project files, but i assume they contain project specific things, like absolute path and name. So it is likely to break or not work correctly. Just create a new project with the same name in the same location for already existing files. i tried it with a fresh clone from the supplied github and it worked like expected (and it gave me the option to create run configurations) – Timmeey Jan 15 '17 at 02:08