I'm going through this difficulty, I'm new to using this technology. Before formatting the machine, this project was running perfectly, I backed up everything and formatted. Now that I try to import the project into the software I come across some errors.
I performed the import through Maven->existing maven projects
, the build runs, but returns the following errors:
- Error in
pom.xml
file. - Some maven dependencies are missing.
- Build path specifies JavaSE-11 execution environment. There are no JREs installed in the workspace that are strictly compatible with this environment.
- The compiler compliance specified is 11 but a JRE 17 is used.
Since then I have been trying to resolve these issues, I have checked the versions of java, jre, jdk and the like. I managed to partially solve the jre problem but after some time I had conflicts again, but involving maven dependencies I didn't get any success.
Honestly I don't understand the reason for the errors, I kept the same computer settings before formatting, that is, I installed the versions that were before.
CodePudding user response:
I would suggest to look into the preferences for the installed JDKs/JREs for your workspace. You can find those settings via Preferences -> Java -> Installed JREs
. There you can see which JREs are configured to be used by the IDE for your projects (in general).
Then, please also take a look at the Execution Environment
category below that preference node. There you can define which JRE should be used for which execution environment. Your project seem to require a JavaSE-11
environment. When you select that environment from the list, you will see which installed JRE the IDE will use to fulfill that JavaSE-11 requirement of the project.
I would also run a Maven -> Update Project---
, since the dependences that are marked in the pom.xml file seem to be just fine, so probably a broken download of those dependencies, but also hard to say without the exact errors being mentioned.