-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I use Visual Studio Code (version 1.50.1 as I write this) with the Language Support for Java(TM) extension by RedHat (version 0.69.0 as I write this) to pretty much write all my Java code.
I have it like this in my pom.xml file:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>8</release>
<source>11</source>
<target>11</target>
<compilerArgs>
<arg>-Xplugin:jabel</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>Just like how it says to do on this project's README. However, the Java support extension read the <release>8</release> tag and sets the language level of the project to JavaSE-1.8, so VS Code complains if I use syntax from Java 9+:
My project compiles correctly through the command prompt, though.
VS Code won't give me an error if I set the <release> tag to 11, as it will set the language level to JavaSE-11, or if I omit it from the pom.xml, as it will default to the JDK I use to run the Java support extension (11 is the minimum):
... but then I imagine the compiler won't actually make the final jar a Java 8 app, right?
Is there a way to fix this?

