-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.classpath keeps changing to Java 1.8, not what is in pom.xml (11) #2511
Comments
please attach a sample project |
I am observing the same behaviour... downgrading from 1.7.0 to 1.6.0 resolves the issue after a clean java workspace. |
@karlvr I can't reproduce the issue. Could you attach a project sample? |
I had a very similar issue with JavaSE-11 being changed to JavaSE-12 automatically by vscode in my maven java projects. In my case it was caused by maven-enforcer-plugin.
from Maybe it is also some maven plugin in your case causing this? |
@kkalass thanks for the tip, this is what my <requireJavaVersion>
<version>[1.8.0,)</version>
</requireJavaVersion> It doesn't feel like I got the right result, as 1.8.0 is just the minimum and it chose 1.8 even though I have both 11 and 17, but changing that to 17 has fixed the issue with VS Code choosing 1.8 for my project in spite of the compiler plugin stipulating 17. Much thanks. |
This may have been related to eclipse-m2e/m2e-core#1099 so if it's still an issue, feel free to re-open. Explanation seems to be that under Eclipse, the JRE used to run the project is the same one used to run Maven. |
I have a project that was generated by JHipster that has always used Java 11, which is specified in the POM.
However, every time .classpath is generated it specifies Java 1.8:
Then I have manually change it to java 11:
This is similar to this issue .classpath file is not updated with new JDK version #1748 where they said to manually trigger a configuration update with the "Update Configuration" command. I have done that and it also changes it to Java 1.8 :/
Environment
Steps To Reproduce
[Please attach a sample project reproducing the error]
Please attach logs
Current Result
.classpath is configured for Java 1.8, not the version specified in pom.xml
Expected Result
.classpath should match the pom.xml file, which is configured for Java 11
Additional Informations
The text was updated successfully, but these errors were encountered: