I am trying to use Visual Studio Code to compile and run a maven-based Java project.
VSCODE requires for itself JDK 11. I installed JDK 11 and added it as java.home in VSCODE "Java: Configure Java Runtime" section.
The project however requires Java 8. I have JDK 8 pointed by JAVA_HOME, and pom.xml specifies
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
However when I compile and try to run the project in VSCODE, I get messages
Build path specifies execution environment JavaSE-1.8. There are no JREs installed in the workspace that are strictly compatible with this environment.
The compiler compliance specified is 1.8 but a JRE 11 is used.
Even though VSCODE knows JDK 8 is reachable:
How do I instruct VSCODE to use JDK 8 (rather than JDK 11) as runtime for the project?
