-1

I was recently trying to pull java code from Github to Eclipse. After a while I was finally able to do it File>Import>Git>Projects from Git I cloned everything over, and choose "Import as general project" for "Wizard for project import". Once everything is in and working, I have never been able to compile or run any of the code. Run>Run Configurations can't find any files to choose for Main.class.

Anything from git it seems doesn't work, even if I fork it. Could anyone help me? Thanks!

  • You should either post the name of the github repository, or (maybe better) ask the maintainer of the repository. – Kai Nov 04 '15 at 07:24
  • Is there a pom.xml file in the project's root folder, or a build.xml file? If you can see neither, it would help if you could post the project structure and what files are in the root folder (or give link to Github) so we can determine what tool is used to build the project. – Jiri Tousek Nov 04 '15 at 07:27

1 Answers1

0

Eclipse uses different project natures (types of projects) to set up builders, etc.

If the Java project you are importing, is not created with Eclipse, it does not have the metadata Eclipse requires to work. Look for a .project file - if its there, you should import the contents of the repository as Java project(s).

If not, then there are still options:

  • If the project is a maven project (look for pom.xml files in the repository), you could use m2e to import it.
  • Make sure that the github repository contains either a single project, or create separate projects for all subprojects. Eclipse does not support hierarchical projects.
  • You could add the required metadata files for your generic project becoming a Java project.
Community
  • 1
  • 1
Zoltán Ujhelyi
  • 13,788
  • 2
  • 32
  • 37