2

I know other people have had this problem, but I can't get it to work.

I imported a project from a git and I get an error saying "Project is not a Java project" when adding a class and it doesn't show up in the run config. Project here if it is something wrong with the project and not eclipse. I've heard answers to this with project facet and maven, but I don't have either.

I am running the latest version of eclipse and clean installed it today

  • @Lost Your GitLab project is a private one, so not visible by the rest of us. What version of Eclipse/Java/Git are you using, and on which OS? – VonC Oct 05 '18 at 04:33
  • Whoops. Made it public now. Eclipse version 4.9.0, Windows 10 on version 1803, Java jdk is 10.0.1, jre is 10.0.2, Eclipse EGit 5.1.1.2 – Lost Walker Oct 05 '18 at 06:13

1 Answers1

1

The error should be "“Source folder is not a Java project”".

Check the content of your .project and .classpath.

You can modify the .project to add the org.eclipse.jdt.core.javanature manually.
(But adding the java facet should be the recommended way)

  • regarding the lack of Java facet, make sure your Eclipse has the right Java version support, as described here.
  • a .project and .classpath can be manually generated or copied from another simple Java Eclispe project.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Looks like I'm missing a .classpath and my .project is quite empty That's probably where my problems are coming from. I feel like it would probably be best to copy paste my code into a new project and just push that to my git. I'll try that tomorrow unless there is some way to re-generate the project and classpath files. On another note, I don't have java facets. Even when I select properties of a fully functional project – Lost Walker Oct 05 '18 at 06:18
  • @LostWalker Agreed. i have updated the answer to address the lack of Java facet or project files. – VonC Oct 05 '18 at 06:22