1

So what happened is I started working on IntelliJ IDEA right from the start of this project. Due to a submission requirement, I had to convert the project into Eclipse compatible form. So I converted it to Eclipse Project. After that, I noticed I cannot really work this project like before. This is what I see after converting my project to Eclipse compatible. I want to undo it. But I am not sure how to go about it.

Error

jait
  • 45
  • 9
  • 1
    It's not working because the `src` directory is not configured as a source directory. – OrangeDog Sep 04 '18 at 11:22
  • 1
    Hint: if using different IDEs is a real requirement for you ... then turn it into a *gradle* based project. Because any decent IDE knows how to work with those, without the need to keeping seperate build files per IDE, or converting them forth and back. – GhostCat Sep 04 '18 at 11:24
  • Possible duplicate of [How to import Eclipse projects to IntelliJ IDEA?](https://stackoverflow.com/questions/13876752/how-to-import-eclipse-projects-to-intellij-idea) – OrangeDog Sep 04 '18 at 11:25
  • Could you try to right click on src and set it as Source. You could also try to add: src/com/company – Gabriel Sep 04 '18 at 11:26
  • See also https://stackoverflow.com/a/43319356/104891. – CrazyCoder Sep 04 '18 at 18:58

2 Answers2

0

You need to present src folder of your project as a source project to intellij idea, so please try taking these steps:

  1. goto File -> Project Structure as:

enter image description here

  1. in the opened window right click on src folder and select Sources:

enter image description here

  • So under Project Settings on the left of the opened window, I had to select 'Modules' and then select my 'src' folder as my Sources. It worked! thanks. – jait Sep 05 '18 at 15:13
0

If you use a build tool like gradle or maven, in Idea you can simply import as a new gradle / maven project. First you remove all folders and files not related to your project (.idea, .workspace, build, etc), and then open it as a new clean project in idea.

Keep in mind, if a team works on a project, .idea, and other IDE (integrated development environment, Idea or Eclipse, for example) settings are not usually committed into a VCS (version control system). Other people will not get your settings of IDE in this case. So make your source code independent from IDE. From the other hand, using a build tool makes life easier. If a new developer joins your projects, it (in theory) is simple as

git checkout project_repository

//For gradle
gradlew clean build

//For maven
mvn clean install

And your code is ready to run!

Yan Khonski
  • 12,225
  • 15
  • 76
  • 114
  • Well, mine is just a basic Java console application. It was just a minor issue I faced because of changing the Settings. – jait Sep 05 '18 at 15:16