Problems Getting Started, cannot find Jetty

Hello,
I have problems getting OpenEMS to work. I followed the steps under “Getting Started”, but after importing the project to Eclipse (step 2.2), I get about 50 errors and 200 warnings, mostly related to unresolvable types:

Eclipse Error Messages
Description Resource Path Location Type
AbstractHandler cannot be resolved to a type RestHandler.java /io.openems.edge.controller.api.rest/src/io/openems/edge/controller/api/rest line 65 Java Problem
AcceptRateLimit cannot be resolved to a type AbstractRestApi.java /io.openems.edge.controller.api.rest/src/io/openems/edge/controller/api/rest line 62 Java Problem
Cannot find /error/org.apache.felix.http.jetty;version=0 Not found in [bnd-cache [C:/Users/Simon/git/openems/cnf/cache/5.2.0/bnd-cache r/w=false], BndPomRepository [name=OSGi R7 API, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-OSGi R7 API.xml], BndPomRepository [name=Enterprise Java APIs, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Enterprise Java APIs.xml], BndPomRepository [name=Testing Bundles, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Testing Bundles.xml], BndPomRepository [name=Maven Central, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Maven Central.xml], Local, Templates, Release] bnd.bnd /io.openems.backend.b2brest line 6 Bndtools Path Problem Marker
Cannot find /error/org.apache.felix.http.jetty;version=0 Not found in [bnd-cache [C:/Users/Simon/git/openems/cnf/cache/5.2.0/bnd-cache r/w=false], BndPomRepository [name=OSGi R7 API, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-OSGi R7 API.xml], BndPomRepository [name=Enterprise Java APIs, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Enterprise Java APIs.xml], BndPomRepository [name=Testing Bundles, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Testing Bundles.xml], BndPomRepository [name=Maven Central, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Maven Central.xml], Local, Templates, Release] bnd.bnd /io.openems.edge.controller.api.rest line 6 Bndtools Path Problem Marker
ConnectionLimit cannot be resolved to a type AbstractRestApi.java /io.openems.edge.controller.api.rest/src/io/openems/edge/controller/api/rest line 63 Java Problem
org.apache.felix.http.jetty;version=0 Not found in [bnd-cache [C:/Users/Simon/git/openems/cnf/cache/5.2.0/bnd-cache r/w=false], BndPomRepository [name=OSGi R7 API, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-OSGi R7 API.xml], BndPomRepository [name=Enterprise Java APIs, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Enterprise Java APIs.xml], BndPomRepository [name=Testing Bundles, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Testing Bundles.xml], BndPomRepository [name=Maven Central, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Maven Central.xml], Local, Templates, Release] bnd.bnd /io.openems.backend.b2brest line 6 Bndtools Path Problem Marker
org.apache.felix.http.jetty;version=0 Not found in [bnd-cache [C:/Users/Simon/git/openems/cnf/cache/5.2.0/bnd-cache r/w=false], BndPomRepository [name=OSGi R7 API, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-OSGi R7 API.xml], BndPomRepository [name=Enterprise Java APIs, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Enterprise Java APIs.xml], BndPomRepository [name=Testing Bundles, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Testing Bundles.xml], BndPomRepository [name=Maven Central, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Maven Central.xml], Local, Templates, Release] bnd.bnd /io.openems.edge.controller.api.rest line 6 Bndtools Path Problem Marker
Request cannot be resolved to a type RestHandler.java /io.openems.edge.controller.api.rest/src/io/openems/edge/controller/api/rest line 76 Java Problem
[…]
Server cannot be resolved to a type AbstractRestApi.java /io.openems.edge.controller.api.rest/src/io/openems/edge/controller/api/rest line 35 Java Problem
[…]
The import org.eclipse cannot be resolved AbstractRestApi.java /io.openems.edge.controller.api.rest/src/io/openems/edge/controller/api/rest line 5 Java Problem
[…]
The project was not built since its build path is incomplete. Cannot find the class file for org.eclipse.jetty.util.Attributes. Fix the build path then try building this project io.openems.backend.b2brest Unknown Java Problem
The type org.eclipse.jetty.util.Attributes cannot be resolved. It is indirectly referenced from required .class files B2bRest.java /io.openems.backend.b2brest/src/io/openems/backend/b2brest line 63 Java Problem
Will not build project io.openems.backend.b2brest until the compilation and/or path problems are fixed, output files are kept. bnd.bnd /io.openems.backend.b2brest line 1 Bndtools Problem Marker
Will not build project io.openems.edge.controller.api.rest until the compilation and/or path problems are fixed, output files are kept. bnd.bnd /io.openems.edge.controller.api.rest line 1 Bndtools Problem Marker
Build path specifies execution environment JavaSE-1.8. There are no JREs installed in the workspace that are strictly compatible with this environment. io.openems.backend.application Build path JRE System Library Problem
[…]
The method newInstance() from the type Class<capture#9-of ?> is deprecated OneWireAccessProvider.java /io.openems.edge.bridge.onewire/src/com/dalsemi/onewire line 285 Java Problem
[…]
The compiler compliance specified is 1.8 but a JRE 14 is used io.openems.edge.controller.ess.limittotaldischarge Compiler Compliance JRE Compiler Compliance Problem
[…]

Two main problems striked me most:

  1. Eclipse cannot find the installed Jetty version
  2. Apparently, JRE 14 is in use, even though in Eclipse under Project / Properties / Java Build Path / Libraries it clearly says that JavaSE-1.8 is being used.

When using Gradle via the terminal instead, the problem is reduced to the Jetty version that cannot be found:

Gradle Error Messages

C:\Users\Simon\git\openems>gradlew.bat build -x test

> Task :io.openems.backend.b2brest:compileJava FAILED
error : Cannot find /error/org.apache.felix.http.jetty;version=0 Not found in [bnd-cache [C:/Users/Simon/git/openems/cnf/cache/5.0.0/bnd-cache r/w=false], BndPomRepository [name=OSGi R7 API, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-OSGi R7 API.xml, inited=true], BndPomRepository [name=Enterprise Java APIs, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Enterprise Java APIs.xml, inited=true], BndPomRepository [name=Testing Bundles, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Testing Bundles.xml, inited=true], BndPomRepository [name=Maven Central, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Maven Central.xml, inited=true], Local, Templates, Release]
error : org.apache.felix.http.jetty;version=0 Not found in [bnd-cache [C:/Users/Simon/git/openems/cnf/cache/5.0.0/bnd-cache r/w=false], BndPomRepository [name=OSGi R7 API, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-OSGi R7 API.xml, inited=true], BndPomRepository [name=Enterprise Java APIs, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Enterprise Java APIs.xml, inited=true], BndPomRepository [name=Testing Bundles, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Testing Bundles.xml, inited=true], BndPomRepository [name=Maven Central, localRepo=C:\Users\Simon.m2\repository, location=cnf/cache/pom-Maven Central.xml, inited=true], Local, Templates, Release]

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:io.openems.backend.b2brest:compileJava’.
> io.openems.backend.b2brest has errors, 2 errors were reported

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 31s
16 actionable tasks: 14 executed, 2 up-to-date

Do you know about this problem or do you have some advice for me? Thanks a lot in advance!

I think you need to change your java version to 8 because higher versions aren’t supported. you need to change it in the settings

Thank you for your reply, I thought I had already changed it in several ways. After countless tries with several operating systems and virtual machines this is what I think finally got it to work:
Eclipse seems to install its own JRE. Change it under Window/Preferences/Java/Installed JREs, then Add->StandardVM->JRE Home and then set the JRE 1.8 folder at C:/Programme/Java.