Why does my project not build when I try to import it to Eclipse?

106 views Asked by At

I have been working on a Java project in Eclipse. The project uses JDK 8 and JUnit 4, both of which are reflected in the build path. With the previous version of Eclipse I had installed, I was able to import this project, edit it, run tests, etc. without issues.

However, I recently updated my MacBook to Sonoma and also had to update Eclipse as a result. When I try to import my project into the new version of Eclipse, I receive the following error:

"The project was not built since its build path is incomplete. Cannot find the class file for java.lang.invoke.StringConcatFactory. Fix the build path then try building this project."

I don't think my project contains anything that requires StringConcatFactory. It does contain a class called Concat that is saved in a file called Concat.java, although I tried changing that (both the name of the class and name of the file) and it didn't help.

Does anyone have any insight as to why I might be getting this error message when the project was running fine on the prior version of Eclipse?

1

There are 1 answers

1
Coder1913 On

It looks like I was able to get it to work by going into the build path and updating the version of Java the project uses to Version 9. Hopefully that doesn't create any other issues with the project (it doesn't look like it will, as the project is no longer throwing any errors in Eclipse).