[Java] I tried to study Java with VScode, and I stumbled a little on path

less than 1 minute read

VScode is good, and I was introduced to it in sync, so I tried it. https://www.suzu6.net/posts/130-vscode-for-java/ I prepared the environment with reference to this person’s blog, but since I was a little stumped on how to pass the path, I will post it.

Stumbling place

Install the extension Java Extension Pack for Java in VScode, Create a new project using maven with ctlr + shift + p, I confidently compiled with F5

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 14 is used

I got the above error.

Solution

For now, if you look at pom.xml

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

1.8… As a test, I tried changing 1.8 to 14 and the error was resolved. It seems to be a word that specifies the compiled version of java with maven.


When I look it up, https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html There seems to be another way to set the compiler.

I want to be a fast engineer. .. ..